- 
      
- 
        Save dsoares/b8c01ef8dc213d5adf4a9aa20da68cb3 to your computer and use it in GitHub Desktop. 
Revisions
- 
        havvg revised this gist Nov 27, 2012 . 1 changed file with 23 additions and 0 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ <?php class MyModel extends BaseMyModel { public function hydrate($row, $startcol = 0, $rehydrate = false) { try { $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; $this->type = ($row[$startcol + 1] !== null) ? $row[$startcol + 1] : null; $this->resetModified(); $this->setNew(false); if ($rehydrate) { $this->ensureConsistency(); } return $startcol + 2; } catch (Exception $e) { throw new PropelException("Error populating MyModel object", $e); } } } 
- 
        havvg revised this gist Dec 8, 2011 . 1 changed file with 17 additions and 0 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ <?php class MyModelTest extends \PHPUnit_Framework_TestCase { public function testEnum() { $obj = new MyModel(); $obj->setType(MyModelPeer::TYPE_IN); $this->assertTrue((bool) $obj->save()); $expected = array( 'IN' => 'IN', 'OUT' => 'OUT', ); $this->assertEquals($expected, MyModelPeer::getValueSet(MyModelPeer::TYPE)); } } 
- 
        havvg revised this gist Dec 8, 2011 . 1 changed file with 12 additions and 0 deletions.There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ <?php class MyModelPeer extends BaseMyModelPeer { /** The enumerated values for this table */ protected static $enumValueSets = array( self::TYPE => array( MyModelPeer::TYPE_IN => MyModelPeer::TYPE_IN, MyModelPeer::TYPE_OUT => MyModelPeer::TYPE_OUT, ), ); } 
- 
        havvg created this gist Dec 8, 2011 .There are no files selected for viewingThis file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- ... --> <column name="type" type="enum" valueSet="IN,OUT" sqlType="ENUM('IN','OUT')" required="true" /> <!-- ... -->