adding a label to the form fields (Datatables column headers)

This commit is contained in:
Naomi 2013-08-07 17:55:18 -04:00
parent aaf2e5c2f6
commit 27b079ace9
11 changed files with 202 additions and 83 deletions

View file

@ -42,6 +42,12 @@ abstract class BaseCcPlayoutHistoryTemplateField extends BaseObject implements
*/
protected $name;
/**
* The value for the label field.
* @var string
*/
protected $label;
/**
* The value for the type field.
* @var string
@ -131,6 +137,16 @@ abstract class BaseCcPlayoutHistoryTemplateField extends BaseObject implements
return $this->name;
}
/**
* Get the [label] column value.
*
* @return string
*/
public function getDbLabel()
{
return $this->label;
}
/**
* Get the [type] column value.
*
@ -225,6 +241,26 @@ abstract class BaseCcPlayoutHistoryTemplateField extends BaseObject implements
return $this;
} // setDbName()
/**
* Set the value of [label] column.
*
* @param string $v new value
* @return CcPlayoutHistoryTemplateField The current object (for fluent API support)
*/
public function setDbLabel($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->label !== $v) {
$this->label = $v;
$this->modifiedColumns[] = CcPlayoutHistoryTemplateFieldPeer::LABEL;
}
return $this;
} // setDbLabel()
/**
* Set the value of [type] column.
*
@ -324,9 +360,10 @@ abstract class BaseCcPlayoutHistoryTemplateField extends BaseObject implements
$this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null;
$this->template_id = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null;
$this->name = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null;
$this->type = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null;
$this->is_file_md = ($row[$startcol + 4] !== null) ? (boolean) $row[$startcol + 4] : null;
$this->position = ($row[$startcol + 5] !== null) ? (int) $row[$startcol + 5] : null;
$this->label = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null;
$this->type = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null;
$this->is_file_md = ($row[$startcol + 5] !== null) ? (boolean) $row[$startcol + 5] : null;
$this->position = ($row[$startcol + 6] !== null) ? (int) $row[$startcol + 6] : null;
$this->resetModified();
$this->setNew(false);
@ -335,7 +372,7 @@ abstract class BaseCcPlayoutHistoryTemplateField extends BaseObject implements
$this->ensureConsistency();
}
return $startcol + 6; // 6 = CcPlayoutHistoryTemplateFieldPeer::NUM_COLUMNS - CcPlayoutHistoryTemplateFieldPeer::NUM_LAZY_LOAD_COLUMNS).
return $startcol + 7; // 7 = CcPlayoutHistoryTemplateFieldPeer::NUM_COLUMNS - CcPlayoutHistoryTemplateFieldPeer::NUM_LAZY_LOAD_COLUMNS).
} catch (Exception $e) {
throw new PropelException("Error populating CcPlayoutHistoryTemplateField object", $e);
@ -672,12 +709,15 @@ abstract class BaseCcPlayoutHistoryTemplateField extends BaseObject implements
return $this->getDbName();
break;
case 3:
return $this->getDbType();
return $this->getDbLabel();
break;
case 4:
return $this->getDbIsFileMD();
return $this->getDbType();
break;
case 5:
return $this->getDbIsFileMD();
break;
case 6:
return $this->getDbPosition();
break;
default:
@ -707,9 +747,10 @@ abstract class BaseCcPlayoutHistoryTemplateField extends BaseObject implements
$keys[0] => $this->getDbId(),
$keys[1] => $this->getDbTemplateId(),
$keys[2] => $this->getDbName(),
$keys[3] => $this->getDbType(),
$keys[4] => $this->getDbIsFileMD(),
$keys[5] => $this->getDbPosition(),
$keys[3] => $this->getDbLabel(),
$keys[4] => $this->getDbType(),
$keys[5] => $this->getDbIsFileMD(),
$keys[6] => $this->getDbPosition(),
);
if ($includeForeignObjects) {
if (null !== $this->aCcPlayoutHistoryTemplate) {
@ -756,12 +797,15 @@ abstract class BaseCcPlayoutHistoryTemplateField extends BaseObject implements
$this->setDbName($value);
break;
case 3:
$this->setDbType($value);
$this->setDbLabel($value);
break;
case 4:
$this->setDbIsFileMD($value);
$this->setDbType($value);
break;
case 5:
$this->setDbIsFileMD($value);
break;
case 6:
$this->setDbPosition($value);
break;
} // switch()
@ -791,9 +835,10 @@ abstract class BaseCcPlayoutHistoryTemplateField extends BaseObject implements
if (array_key_exists($keys[0], $arr)) $this->setDbId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setDbTemplateId($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setDbName($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setDbType($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setDbIsFileMD($arr[$keys[4]]);
if (array_key_exists($keys[5], $arr)) $this->setDbPosition($arr[$keys[5]]);
if (array_key_exists($keys[3], $arr)) $this->setDbLabel($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setDbType($arr[$keys[4]]);
if (array_key_exists($keys[5], $arr)) $this->setDbIsFileMD($arr[$keys[5]]);
if (array_key_exists($keys[6], $arr)) $this->setDbPosition($arr[$keys[6]]);
}
/**
@ -808,6 +853,7 @@ abstract class BaseCcPlayoutHistoryTemplateField extends BaseObject implements
if ($this->isColumnModified(CcPlayoutHistoryTemplateFieldPeer::ID)) $criteria->add(CcPlayoutHistoryTemplateFieldPeer::ID, $this->id);
if ($this->isColumnModified(CcPlayoutHistoryTemplateFieldPeer::TEMPLATE_ID)) $criteria->add(CcPlayoutHistoryTemplateFieldPeer::TEMPLATE_ID, $this->template_id);
if ($this->isColumnModified(CcPlayoutHistoryTemplateFieldPeer::NAME)) $criteria->add(CcPlayoutHistoryTemplateFieldPeer::NAME, $this->name);
if ($this->isColumnModified(CcPlayoutHistoryTemplateFieldPeer::LABEL)) $criteria->add(CcPlayoutHistoryTemplateFieldPeer::LABEL, $this->label);
if ($this->isColumnModified(CcPlayoutHistoryTemplateFieldPeer::TYPE)) $criteria->add(CcPlayoutHistoryTemplateFieldPeer::TYPE, $this->type);
if ($this->isColumnModified(CcPlayoutHistoryTemplateFieldPeer::IS_FILE_MD)) $criteria->add(CcPlayoutHistoryTemplateFieldPeer::IS_FILE_MD, $this->is_file_md);
if ($this->isColumnModified(CcPlayoutHistoryTemplateFieldPeer::POSITION)) $criteria->add(CcPlayoutHistoryTemplateFieldPeer::POSITION, $this->position);
@ -874,6 +920,7 @@ abstract class BaseCcPlayoutHistoryTemplateField extends BaseObject implements
{
$copyObj->setDbTemplateId($this->template_id);
$copyObj->setDbName($this->name);
$copyObj->setDbLabel($this->label);
$copyObj->setDbType($this->type);
$copyObj->setDbIsFileMD($this->is_file_md);
$copyObj->setDbPosition($this->position);
@ -977,6 +1024,7 @@ abstract class BaseCcPlayoutHistoryTemplateField extends BaseObject implements
$this->id = null;
$this->template_id = null;
$this->name = null;
$this->label = null;
$this->type = null;
$this->is_file_md = null;
$this->position = null;

View file

@ -26,7 +26,7 @@ abstract class BaseCcPlayoutHistoryTemplateFieldPeer {
const TM_CLASS = 'CcPlayoutHistoryTemplateFieldTableMap';
/** The total number of columns. */
const NUM_COLUMNS = 6;
const NUM_COLUMNS = 7;
/** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0;
@ -40,6 +40,9 @@ abstract class BaseCcPlayoutHistoryTemplateFieldPeer {
/** the column name for the NAME field */
const NAME = 'cc_playout_history_template_field.NAME';
/** the column name for the LABEL field */
const LABEL = 'cc_playout_history_template_field.LABEL';
/** the column name for the TYPE field */
const TYPE = 'cc_playout_history_template_field.TYPE';
@ -65,12 +68,12 @@ abstract class BaseCcPlayoutHistoryTemplateFieldPeer {
* e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
*/
private static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbTemplateId', 'DbName', 'DbType', 'DbIsFileMD', 'DbPosition', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbTemplateId', 'dbName', 'dbType', 'dbIsFileMD', 'dbPosition', ),
BasePeer::TYPE_COLNAME => array (self::ID, self::TEMPLATE_ID, self::NAME, self::TYPE, self::IS_FILE_MD, self::POSITION, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'TEMPLATE_ID', 'NAME', 'TYPE', 'IS_FILE_MD', 'POSITION', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'template_id', 'name', 'type', 'is_file_md', 'position', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, )
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbTemplateId', 'DbName', 'DbLabel', 'DbType', 'DbIsFileMD', 'DbPosition', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbTemplateId', 'dbName', 'dbLabel', 'dbType', 'dbIsFileMD', 'dbPosition', ),
BasePeer::TYPE_COLNAME => array (self::ID, self::TEMPLATE_ID, self::NAME, self::LABEL, self::TYPE, self::IS_FILE_MD, self::POSITION, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'TEMPLATE_ID', 'NAME', 'LABEL', 'TYPE', 'IS_FILE_MD', 'POSITION', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'template_id', 'name', 'label', 'type', 'is_file_md', 'position', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
);
/**
@ -80,12 +83,12 @@ abstract class BaseCcPlayoutHistoryTemplateFieldPeer {
* e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
private static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbTemplateId' => 1, 'DbName' => 2, 'DbType' => 3, 'DbIsFileMD' => 4, 'DbPosition' => 5, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbTemplateId' => 1, 'dbName' => 2, 'dbType' => 3, 'dbIsFileMD' => 4, 'dbPosition' => 5, ),
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::TEMPLATE_ID => 1, self::NAME => 2, self::TYPE => 3, self::IS_FILE_MD => 4, self::POSITION => 5, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'TEMPLATE_ID' => 1, 'NAME' => 2, 'TYPE' => 3, 'IS_FILE_MD' => 4, 'POSITION' => 5, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'template_id' => 1, 'name' => 2, 'type' => 3, 'is_file_md' => 4, 'position' => 5, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, )
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbTemplateId' => 1, 'DbName' => 2, 'DbLabel' => 3, 'DbType' => 4, 'DbIsFileMD' => 5, 'DbPosition' => 6, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbTemplateId' => 1, 'dbName' => 2, 'dbLabel' => 3, 'dbType' => 4, 'dbIsFileMD' => 5, 'dbPosition' => 6, ),
BasePeer::TYPE_COLNAME => array (self::ID => 0, self::TEMPLATE_ID => 1, self::NAME => 2, self::LABEL => 3, self::TYPE => 4, self::IS_FILE_MD => 5, self::POSITION => 6, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'TEMPLATE_ID' => 1, 'NAME' => 2, 'LABEL' => 3, 'TYPE' => 4, 'IS_FILE_MD' => 5, 'POSITION' => 6, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'template_id' => 1, 'name' => 2, 'label' => 3, 'type' => 4, 'is_file_md' => 5, 'position' => 6, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, )
);
/**
@ -160,6 +163,7 @@ abstract class BaseCcPlayoutHistoryTemplateFieldPeer {
$criteria->addSelectColumn(CcPlayoutHistoryTemplateFieldPeer::ID);
$criteria->addSelectColumn(CcPlayoutHistoryTemplateFieldPeer::TEMPLATE_ID);
$criteria->addSelectColumn(CcPlayoutHistoryTemplateFieldPeer::NAME);
$criteria->addSelectColumn(CcPlayoutHistoryTemplateFieldPeer::LABEL);
$criteria->addSelectColumn(CcPlayoutHistoryTemplateFieldPeer::TYPE);
$criteria->addSelectColumn(CcPlayoutHistoryTemplateFieldPeer::IS_FILE_MD);
$criteria->addSelectColumn(CcPlayoutHistoryTemplateFieldPeer::POSITION);
@ -167,6 +171,7 @@ abstract class BaseCcPlayoutHistoryTemplateFieldPeer {
$criteria->addSelectColumn($alias . '.ID');
$criteria->addSelectColumn($alias . '.TEMPLATE_ID');
$criteria->addSelectColumn($alias . '.NAME');
$criteria->addSelectColumn($alias . '.LABEL');
$criteria->addSelectColumn($alias . '.TYPE');
$criteria->addSelectColumn($alias . '.IS_FILE_MD');
$criteria->addSelectColumn($alias . '.POSITION');

View file

@ -9,6 +9,7 @@
* @method CcPlayoutHistoryTemplateFieldQuery orderByDbId($order = Criteria::ASC) Order by the id column
* @method CcPlayoutHistoryTemplateFieldQuery orderByDbTemplateId($order = Criteria::ASC) Order by the template_id column
* @method CcPlayoutHistoryTemplateFieldQuery orderByDbName($order = Criteria::ASC) Order by the name column
* @method CcPlayoutHistoryTemplateFieldQuery orderByDbLabel($order = Criteria::ASC) Order by the label column
* @method CcPlayoutHistoryTemplateFieldQuery orderByDbType($order = Criteria::ASC) Order by the type column
* @method CcPlayoutHistoryTemplateFieldQuery orderByDbIsFileMD($order = Criteria::ASC) Order by the is_file_md column
* @method CcPlayoutHistoryTemplateFieldQuery orderByDbPosition($order = Criteria::ASC) Order by the position column
@ -16,6 +17,7 @@
* @method CcPlayoutHistoryTemplateFieldQuery groupByDbId() Group by the id column
* @method CcPlayoutHistoryTemplateFieldQuery groupByDbTemplateId() Group by the template_id column
* @method CcPlayoutHistoryTemplateFieldQuery groupByDbName() Group by the name column
* @method CcPlayoutHistoryTemplateFieldQuery groupByDbLabel() Group by the label column
* @method CcPlayoutHistoryTemplateFieldQuery groupByDbType() Group by the type column
* @method CcPlayoutHistoryTemplateFieldQuery groupByDbIsFileMD() Group by the is_file_md column
* @method CcPlayoutHistoryTemplateFieldQuery groupByDbPosition() Group by the position column
@ -34,6 +36,7 @@
* @method CcPlayoutHistoryTemplateField findOneByDbId(int $id) Return the first CcPlayoutHistoryTemplateField filtered by the id column
* @method CcPlayoutHistoryTemplateField findOneByDbTemplateId(int $template_id) Return the first CcPlayoutHistoryTemplateField filtered by the template_id column
* @method CcPlayoutHistoryTemplateField findOneByDbName(string $name) Return the first CcPlayoutHistoryTemplateField filtered by the name column
* @method CcPlayoutHistoryTemplateField findOneByDbLabel(string $label) Return the first CcPlayoutHistoryTemplateField filtered by the label column
* @method CcPlayoutHistoryTemplateField findOneByDbType(string $type) Return the first CcPlayoutHistoryTemplateField filtered by the type column
* @method CcPlayoutHistoryTemplateField findOneByDbIsFileMD(boolean $is_file_md) Return the first CcPlayoutHistoryTemplateField filtered by the is_file_md column
* @method CcPlayoutHistoryTemplateField findOneByDbPosition(int $position) Return the first CcPlayoutHistoryTemplateField filtered by the position column
@ -41,6 +44,7 @@
* @method array findByDbId(int $id) Return CcPlayoutHistoryTemplateField objects filtered by the id column
* @method array findByDbTemplateId(int $template_id) Return CcPlayoutHistoryTemplateField objects filtered by the template_id column
* @method array findByDbName(string $name) Return CcPlayoutHistoryTemplateField objects filtered by the name column
* @method array findByDbLabel(string $label) Return CcPlayoutHistoryTemplateField objects filtered by the label column
* @method array findByDbType(string $type) Return CcPlayoutHistoryTemplateField objects filtered by the type column
* @method array findByDbIsFileMD(boolean $is_file_md) Return CcPlayoutHistoryTemplateField objects filtered by the is_file_md column
* @method array findByDbPosition(int $position) Return CcPlayoutHistoryTemplateField objects filtered by the position column
@ -223,6 +227,28 @@ abstract class BaseCcPlayoutHistoryTemplateFieldQuery extends ModelCriteria
return $this->addUsingAlias(CcPlayoutHistoryTemplateFieldPeer::NAME, $dbName, $comparison);
}
/**
* Filter the query on the label column
*
* @param string $dbLabel The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CcPlayoutHistoryTemplateFieldQuery The current query, for fluid interface
*/
public function filterByDbLabel($dbLabel = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($dbLabel)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $dbLabel)) {
$dbLabel = str_replace('*', '%', $dbLabel);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CcPlayoutHistoryTemplateFieldPeer::LABEL, $dbLabel, $comparison);
}
/**
* Filter the query on the type column
*