Public feed #887702

Anonymous

public text v1 · immutable
Raw Edit
·published 2008-02-01 15:20 UTC
rendered paste body
<?php

class Product extends Doctrine_Record 
{
    public function setTableDefinition()
    {      
        $this -> setTableName('products');
        
        $this -> hasColumn('name', 'string', 50);
        $this -> hasColumn('description', 'text');
        $this -> hasColumn('image', 50);
        $this -> hasColumn('price', 'decimal');
        $this -> hasColumn('company', 'integer');
        
        $this -> option('type', 'INNODB');
        $this -> option('collate', 'utf8_general_ci');
        $this -> option('charset', 'utf8');
    }
    
    public function setUp(){
        $this -> hasOne('Company', array('local' => 'company', 'foreign' => 'id'));
    }
}

?>