#850: Class table inheritance with primary key column alias or other name than
id, cause query to fail
---------------------+------------------------------------------------------
  Reporter:  rulcom  |       Owner:  somebody             
      Type:  defect  |      Status:  reopened             
  Priority:  minor   |   Milestone:  0.10.4               
 Component:  Other   |     Version:  0.10                 
Resolution:          |    Keywords:                       
  Has_test:  0       |    Mystatus:  Pending Core Response
 Has_patch:  0       |  
---------------------+------------------------------------------------------
Changes (by enrico):

  * status:  closed => reopened
  * resolution:  worksforme =>
  * has_patch:  => 0
  * mystatus:  => Pending Core Response
  * has_test:  => 0

Comment:

 Hello,

 here is another example which doesnt work in 1.0.2:


 {{{
 class Entity extends Doctrine_Record
 {
         public function setTableDefinition()
         {
                 $this->hasColumn('entityId', 'integer', 20,
 array('primary' => true, 'autoincrement' => true));
                 $this->hasColumn('name', 'string', 100);
         }
 }

 class User extends Entity
 {
         public function setTableDefinition()
         {
                 $this->hasColumn('entityId as id', 'integer', 20,
 array('primary' => true, 'autoincrement' => true));
         }
 }

 Doctrine::createTablesFromArray(array('Entity', 'User'));

 $user = new User();
 $user->name = 'someone';
 $user->save();

 $user = $conn->getTable('User')->find(1);
 $user->name = 'test';
 $user->save();
 }}}

 The second save() triggers an INSERT, don't know why.

-- 
Ticket URL: <http://trac.doctrine-project.org/ticket/850#comment:3>
Doctrine <http://www.phpdoctrine.org>
PHP Doctrine Object Relational Mapper
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"doctrine-svn" 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.co.uk/group/doctrine-svn?hl=en-GB
-~----------~----~----~----~------~----~------~--~---

Reply via email to