Hi,
I have Scaffold a table and when I try to edit a result, I'm getting this message :
Cannot resolve attribute "Id' in the model
The thing is that I don't have any column named "Id". Here's my model class :
<?php
class User extends \Phalcon\Mvc\Model {
/**
*
* @var integer
*/
public $UserID;
/**
*
* @var string
*/
public $Email;
/**
*
* @var string
*/
public $Firstname;
/**
*
* @var string
*/
public $Lastname;
/**
*
* @var integer
*/
public $IsBlocked;
/**
*
* @var string
*/
public $Password;
/**
*
* @var string
*/
public $Type;
/**
* Initialize method for model.
*/
public function initialize() {
$this->setSource('User');
$this->hasMany("UserID", "UserRole", "UserID");
$this->hasMany("UserID", "UserModule", "UserID");
}
/**
* Independent Column Mapping.
*/
public function columnMap() {
return array(
'UserID' => 'UserID',
'Email' => 'Email',
'Firstname' => 'Firstname',
'Lastname' => 'Lastname',
'IsBlocked' => 'IsBlocked',
'Password' => 'Password',
'Type' => 'Type'
);
}
}
Is there something I'm doing wrong here ? The model have been generated before the scaffold.
thank you.
Daniel