domain-model-mapper
domain-model-mapper copied to clipboard
Problem with identifier
Hello, first thanks for sharing your work.
I am setting this model:
$user = new User;
//$user->USER_ID = null
$user->FULL_NAME = 'DBTEST_1';
$user->EMAIL = 'DBTEST_2';
$user->LOGIN = 'test';
$user->PASSWORD = '123456';
If I don't set the identifier field on the model class, the "find" method in "Mapper" class executes the following sql sentence with error.
SENTENCE: "SELECT * FROM USER WHERE "
PDO ERROR: Array
(
[0] => HY000
[1] => 936
[2] => OCIStmtExecute: ORA-00936: missing expression
(/home/galonso/php/php-5.3.21/ext/pdo_oci/oci_statement.c:148)
)
That happens because the method "__identity" on "BaseDomainModel" class only return those identifiers that exists and are not empty in model class data. Is this correct?
Am I doing something wrong?
@g-alonso Are you using SAVE method or INSERT method to populate the object ?
@juan-sanzone-olx I dont remember, I will check this...