# File core/lib/Thelia/Model/map/CouponOrderTableMap.php | thelia

     1: <?php
     2:
     3: namespace Thelia\Model\map;
     4:
     5: use \RelationMap;
     6: use \TableMap;
     7:
     8:
     9: /**
    10:  * This class defines the structure of the 'coupon_order' table.
    11:  *
    12:  *
    13:  *
    14:  * This map class is used by Propel to do runtime db structure discovery.
    15:  * For example, the createSelectSql() method checks the type of a given column used in an
    16:  * ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
    17:  * (i.e. if it's a text column type).
    18:  *
    19:  * @package    propel.generator.Thelia.Model.map
    20:  */
    21: class CouponOrderTableMap extends TableMap
    22: {
    23:
    24:     /**
    25:      * The (dot-path) name of this class
    26:      */
    27:     const CLASS_NAME = 'Thelia.Model.map.CouponOrderTableMap';
    28:
    29:     /**
    30:      * Initialize the table attributes, columns and validators
    31:      * Relations are not initialized by this method since they are lazy loaded
    32:      *
    33:      * @return void
    34:      * @throws PropelException
    35:      */
    36:     public function initialize()
    37:     {
    38:         // attributes
    39:         $this->setName('coupon_order');
    40:         $this->setPhpName('CouponOrder');
    41:         $this->setClassname('Thelia\\Model\\CouponOrder');
    42:         $this->setPackage('Thelia.Model');
    43:         $this->setUseIdGenerator(true);
    44:         // columns
    45:         $this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null);
    46:         $this->addForeignKey('ORDER_ID', 'OrderId', 'INTEGER', 'order', 'ID', true, null, null);
    47:         $this->addColumn('CODE', 'Code', 'VARCHAR', true, 45, null);
    48:         $this->addColumn('VALUE', 'Value', 'FLOAT', true, null, null);
    49:         $this->addColumn('CREATED_AT', 'CreatedAt', 'TIMESTAMP', false, null, null);
    50:         $this->addColumn('UPDATED_AT', 'UpdatedAt', 'TIMESTAMP', false, null, null);
    51:         // validators
    52:     } // initialize()
    53:
    54:     /**
    55:      * Build the RelationMap objects for this table relationships
    56:      */
    57:     public function buildRelations()
    58:     {
    59:         $this->addRelation('Order', 'Thelia\\Model\\Order', RelationMap::MANY_TO_ONE, array('order_id' => 'id', ), 'CASCADE', 'RESTRICT');
    60:     } // buildRelations()
    61:
    62:     /**
    63:      *
    64:      * Gets the list of behaviors registered for this table
    65:      *
    66:      * @return array Associative array (name => parameters) of behaviors
    67:      */
    68:     public function getBehaviors()
    69:     {
    70:         return array(
    71:             'timestampable' => array('create_column' => 'created_at', 'update_column' => 'updated_at', 'disable_updated_at' => 'false', ),
    72:         );
    73:     } // getBehaviors()
    74:
    75: } // CouponOrderTableMap
    76: