Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Notice (8): Undefined property:

Tags:

cakephp-1.3

Please help me with this: am I missing something?

I am getting following error:

Notice (8): Undefined property: Property::$Project [APP\controllers\properties_controller.php, line 614]

// This is code where warning occurs

$projects = $this->Property->Project->find('list');

and in project.php (model file)

var $hasMany = array(
    'Property' => array(
        'className' => 'Property',
        'foreignKey' => 'project_id',
        'dependent' => true,
        'conditions' => '',
        'fields' => '',
        'order' => '',
        'limit' => '',
        'offset' => '',
        'exclusive' => '',
        'finderQuery' => '',
        'counterQuery' => ''
    )
);
like image 865
vibha Avatar asked Mar 22 '26 19:03

vibha


1 Answers

Add in property.php var $belongsTo = 'Project'.

like image 153
TuteC Avatar answered Mar 24 '26 07:03

TuteC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!