Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

underscore and camelCase interchangeable in Yii?

$
0
0
Hi, I'm really new to Yii. I was just wondering if using this_style and thisStyle really matters to Yii when referring to AR attributes. For example, how come I can write:

        $newProject=new Project;
        $newProjectName = 'Test Project Creation';
        $newProject->setAttributes(array(
                'name' => $newProjectName,
                'description' => 'This is a test for new project creation',
                'createTime' => '2009-09-09 00:00:00',
                'createUser' => '1',
                'updateTime' => '2009-09-09 00:00:00',
                'updateUser' => '1',
            )
        );


When the table columns are actually using underscores. (see snippet from fixture below) I'm kinda confused. Is Yii doing something automagically for me?

'project1'=>array(
        'name' => 'Test Project 1',
        'description' => 'This is test project 1',
        'create_time' => '',
        'create_user_id' => '',
        'update_time' => '',
        'update_user_id' => '',
    ),

Viewing all articles
Browse latest Browse all 18717

Trending Articles