It's on the Api (
http://api.cakephp.org/class_model.html#739289e67fa7b2239c9fb1f90627dc17
):
Model::create($data = array(), $filterKey = false)
Initializes the model for writing a new record, loading the default
values for those fields that are not defined in $data.
Call save() after each create().
On Fri, Jun 13, 2008 at 11:31 AM, leo <[EMAIL PROTECTED]> wrote:
>
> I was guessing something like that. I don't see it in the manual.
> Should it be after each create or at the end of the whole lot?
>
> On 13 Juny, 16:28, "Dardo Sordi Bogado" <[EMAIL PROTECTED]> wrote:
>> You are missing the call to save() after create()
>>
>> On Fri, Jun 13, 2008 at 11:27 AM, leo <[EMAIL PROTECTED]> wrote:
>>
>> > Following the example in the manual, I cerated the tables succesfully.
>>
>> > I am now trying to populate the tables with this code: (it's a
>> > paraphrase of the manual example)
>>
>> > function index() {
>> > $aro = new Aro();
>>
>> > // First, set up a few AROs.
>> > // These objects will have no parent initially.
>>
>> > $aro->create( 1, null, '[EMAIL PROTECTED]' );
>> > $aro->create( 2, null, '[EMAIL PROTECTED]');
>> > $aro->create( 3, null, '[EMAIL PROTECTED]');
>>
>> > // Now, we can make groups to organize these users:
>> > // Notice that the IDs for these objects are 0, because
>> > // they will never tie to users in our system
>>
>> > $aro->create(0, null, 'Admin');
>> > $aro->create(0, null, 'Users');
>>
>> > //Now, hook AROs to their respective groups:
>>
>> > $aro->setParent('Admin', '[EMAIL PROTECTED]');
>> > $aro->setParent('Users', '[EMAIL PROTECTED]');
>> > $aro->setParent('Users', '[EMAIL PROTECTED]');
>>
>> > $aco = new Aco();
>>
>> > //Create some access control objects:
>> > $aco->create(1, null, 'Electric Guitar');
>>
>> > $aco->create(2, null, 'United States Army');
>> > $aco->create(3, null, 'Fans');
>>
>> > $this->User->recursive = 0;
>> > $this->set('usuaris', $this->paginate());
>> > }
>>
>> > For ease of access and because I ultimately want to control ACL from
>> > there, I put this in the users controller in the index action.
>>
>> > It runs every line without complaint, but puts nothing in the db. What
>> > am I doing wrong / not doing at all?
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---