deblan.tv/vendor/trinity/src/Trinity/Bundle/MediaBundle/Model/map/TypeTableMap.php

102 lines
3.3 KiB
PHP

<?php
namespace Trinity\Bundle\MediaBundle\Model\map;
use \RelationMap;
use \TableMap;
/**
* This class defines the structure of the 'media_type' table.
*
*
*
* This map class is used by Propel to do runtime db structure discovery.
* For example, the createSelectSql() method checks the type of a given column used in an
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive
* (i.e. if it's a text column type).
*
* @package propel.generator.vendor.trinity.src.Trinity.Bundle.MediaBundle.Model.map
*/
class TypeTableMap extends TableMap
{
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'vendor.trinity.src.Trinity.Bundle.MediaBundle.Model.map.TypeTableMap';
/**
* Initialize the table attributes, columns and validators
* Relations are not initialized by this method since they are lazy loaded
*
* @return void
* @throws PropelException
*/
public function initialize()
{
// attributes
$this->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