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

103 lines
3.7 KiB
PHP

<?php
namespace Trinity\Bundle\MediaBundle\Model\map;
use \RelationMap;
use \TableMap;
/**
* This class defines the structure of the 'media_category' 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 CategoryTableMap extends TableMap
{
/**
* The (dot-path) name of this class
*/
const CLASS_NAME = 'vendor.trinity.src.Trinity.Bundle.MediaBundle.Model.map.CategoryTableMap';
/**
* 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_category');
$this->setPhpName('Category');
$this->setClassname('Trinity\\Bundle\\MediaBundle\\Model\\Category');
$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->addForeignKey('category_id', 'CategoryId', 'INTEGER', 'media_category', 'id', false, null, null);
$this->addColumn('created_at', 'CreatedAt', 'TIMESTAMP', false, null, null);
$this->addColumn('updated_at', 'UpdatedAt', 'TIMESTAMP', false, null, null);
$this->addColumn('slug', 'Slug', 'VARCHAR', false, 255, null);
$this->addColumn('tree_left', 'TreeLeft', 'INTEGER', false, null, null);
$this->addColumn('tree_right', 'TreeRight', 'INTEGER', false, null, null);
$this->addColumn('tree_level', 'TreeLevel', 'INTEGER', false, null, null);
// validators
} // initialize()
/**
* Build the RelationMap objects for this table relationships
*/
public function buildRelations()
{
$this->addRelation('CategoryRelatedByCategoryId', 'Trinity\\Bundle\\MediaBundle\\Model\\Category', RelationMap::MANY_TO_ONE, array('category_id' => 'id', ), null, 'CASCADE');
$this->addRelation('Media', 'Trinity\\Bundle\\MediaBundle\\Model\\Media', RelationMap::ONE_TO_MANY, array('id' => 'category_id', ), null, null, 'Medias');
$this->addRelation('CategoryRelatedById', 'Trinity\\Bundle\\MediaBundle\\Model\\Category', RelationMap::ONE_TO_MANY, array('id' => 'category_id', ), null, 'CASCADE', 'CategoriesRelatedById');
} // 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',
),
'sluggable' => array (
'add_cleanup' => 'true',
'slug_column' => 'slug',
'slug_pattern' => '{Label}',
'replace_pattern' => '/\\W+/',
'replacement' => '-',
'separator' => '-',
'permanent' => 'false',
'scope_column' => '',
),
'nested_set' => array (
'left_column' => 'tree_left',
'right_column' => 'tree_right',
'level_column' => 'tree_level',
'use_scope' => 'false',
'scope_column' => 'tree_scope',
'method_proxies' => 'false',
),
);
} // getBehaviors()
} // CategoryTableMap