#1671: Column aggregation inheritance based on bool in PgSQL
------------------------------+---------------------------------------------
  Reporter:  j.debowczyk      |       Owner:  romanb               
      Type:  defect           |      Status:  closed               
  Priority:  major            |   Milestone:                       
 Component:  Query/Hydration  |     Version:  1.0.3                
Resolution:  invalid          |    Keywords:  pgsql inheritnace    
  Has_test:  1                |    Mystatus:  Pending Core Response
 Has_patch:  0                |  
------------------------------+---------------------------------------------
Changes (by jwage):

  * status:  new => closed
  * resolution:  => invalid

Comment:

 Try this:

 {{{
 class Jacek_BoolSubclass_Parent extends Doctrine_Record
 {
         public function setTableDefinition()
         {
                 parent::setTableDefinition();
             $this->hasColumn('id', 'integer', 4, array('ntype' => 'int4',
 'alltypes' =>  array(  0 => 'integer', ), 'unsigned' => false, 'notnull'
 => true, 'primary' => true));
                 $this->hasColumn('child1', 'boolean');
                 $this->setSubclasses(array(
                                 'Jacek_BoolSubclass_Child1' => array
 ('child1' => 'true'),
                                 'Jacek_BoolSubclass_Child2' => array
 ('child1' => 'false')
                 ));
         }

 }
 }}}

 If you just specify php type boolean true/false, it is evaluated as '' and
 '1' when you convert it to a string. Though, I wouldn't recommend setting
 up your classes this way. With a boolean type controlling the column
 aggregation children then you can only have 2 children ever. Re-open if
 this does not work.

-- 
Ticket URL: <http://trac.doctrine-project.org/ticket/1671#comment:1>
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