setName('media_type'); $this->setPhpName('Type'); $this->setClassname('Trinity\\Bundle\\MediaBundle\\Model\\Type'); $this->setPackage('vendor.trinity.src.Trinity.Bundle.MediaBundle.Model'); $this->setUseIdGenerator(true); // columns $this->addPrimaryKey('id', 'Id', 'INTEGER', true, null, null); $this->addColumn('label', 'Label', 'VARCHAR', true, 255, null); $this->addColumn('icon', 'Icon', 'VARCHAR', true, 255, null); $this->addColumn('thumbnail', 'Thumbnail', 'VARCHAR', true, 255, null); $this->addColumn('mimes', 'Mimes', 'LONGVARCHAR', true, 255, null); $this->addColumn('created_at', 'CreatedAt', 'TIMESTAMP', false, null, null); $this->addColumn('updated_at', 'UpdatedAt', 'TIMESTAMP', false, null, null); $this->addColumn('sortable_rank', 'SortableRank', 'INTEGER', false, null, null); $this->addColumn('slug', 'Slug', 'VARCHAR', false, 255, null); // validators } // initialize() /** * Build the RelationMap objects for this table relationships */ public function buildRelations() { $this->addRelation('Media', 'Trinity\\Bundle\\MediaBundle\\Model\\Media', RelationMap::ONE_TO_MANY, array('id' => 'type_id', ), 'SET NULL', 'SET NULL', 'Medias'); } // buildRelations() /** * * Gets the list of behaviors registered for this table * * @return array Associative array (name => parameters) of behaviors */ public function getBehaviors() { return array( 'timestampable' => array ( 'create_column' => 'created_at', 'update_column' => 'updated_at', 'disable_updated_at' => 'false', ), 'sortable' => array ( 'rank_column' => 'sortable_rank', 'use_scope' => 'false', 'scope_column' => 'sortable_scope', ), 'sluggable' => array ( 'add_cleanup' => 'true', 'slug_column' => 'slug', 'slug_pattern' => '{Label}', 'replace_pattern' => '/\\W+/', 'replacement' => '-', 'separator' => '-', 'permanent' => 'false', 'scope_column' => '', ), 'uploadable' => array ( 'fields' => 'thumbnail, icon', 'paths' => 'uploads/media/type/thumbnail, uploads/media/type/icon', ), ); } // getBehaviors() } // TypeTableMap