Transport.php 992 Bytes
<?php 
/**
 * Transport model
 *
 */

class Transport extends ActiveRecord
{
    /**
     * REST behavior
     */
    public function behaviors()
    {
        return array(
            'RestModelBehavior' => array(
                'class' => 'WRestModelBehavior',
            )
        );
    }
    
    
    /**
     * Returns current model
     */
    public static function model( $className = __CLASS__ )
    {
        return parent::model($className);
    }
    
    
    /**
     * Return table name to which this model is related
     */
    public function tableName()
    {
        return 'transport';
    }
    

    /**
     * Return table primary key name
     */
    public function primaryKey()
    {
        return 'id';
    }
    
    /**
     * Model rules
     */
    public function rules(){
        return array(
            array('domain, transport', 'required', 'on' => 'insert'),
            array('domain, transport', 'required', 'on' => 'update')
        );
    }
}