Add downgrade action to UpgradeController, fix SoundCloud schema and bugs

This commit is contained in:
Duncan Sommerville 2015-06-24 18:38:04 -04:00
parent 8fcaf7fc74
commit 67155b136a
14 changed files with 361 additions and 93 deletions

View file

@ -36,9 +36,11 @@ class CeleryTasksTableMap extends TableMap
$this->setPhpName('CeleryTasks');
$this->setClassname('CeleryTasks');
$this->setPackage('airtime');
$this->setUseIdGenerator(false);
$this->setUseIdGenerator(true);
$this->setPrimaryKeyMethodInfo('celery_tasks_id_seq');
// columns
$this->addPrimaryKey('id', 'DbId', 'VARCHAR', true, 256, null);
$this->addPrimaryKey('id', 'DbId', 'INTEGER', true, null, null);
$this->addColumn('task_id', 'DbTaskId', 'VARCHAR', true, 256, null);
$this->addForeignKey('track_reference', 'DbTrackReference', 'INTEGER', 'third_party_track_references', 'id', true, null, null);
$this->addColumn('name', 'DbName', 'VARCHAR', false, 256, null);
$this->addColumn('dispatch_time', 'DbDispatchTime', 'TIMESTAMP', false, null, null);

View file

@ -31,10 +31,16 @@ abstract class BaseCeleryTasks extends BaseObject implements Persistent
/**
* The value for the id field.
* @var string
* @var int
*/
protected $id;
/**
* The value for the task_id field.
* @var string
*/
protected $task_id;
/**
* The value for the track_reference field.
* @var int
@ -87,7 +93,7 @@ abstract class BaseCeleryTasks extends BaseObject implements Persistent
/**
* Get the [id] column value.
*
* @return string
* @return int
*/
public function getDbId()
{
@ -95,6 +101,17 @@ abstract class BaseCeleryTasks extends BaseObject implements Persistent
return $this->id;
}
/**
* Get the [task_id] column value.
*
* @return string
*/
public function getDbTaskId()
{
return $this->task_id;
}
/**
* Get the [track_reference] column value.
*
@ -166,13 +183,13 @@ abstract class BaseCeleryTasks extends BaseObject implements Persistent
/**
* Set the value of [id] column.
*
* @param string $v new value
* @param int $v new value
* @return CeleryTasks The current object (for fluent API support)
*/
public function setDbId($v)
{
if ($v !== null && is_numeric($v)) {
$v = (string) $v;
$v = (int) $v;
}
if ($this->id !== $v) {
@ -184,6 +201,27 @@ abstract class BaseCeleryTasks extends BaseObject implements Persistent
return $this;
} // setDbId()
/**
* Set the value of [task_id] column.
*
* @param string $v new value
* @return CeleryTasks The current object (for fluent API support)
*/
public function setDbTaskId($v)
{
if ($v !== null && is_numeric($v)) {
$v = (string) $v;
}
if ($this->task_id !== $v) {
$this->task_id = $v;
$this->modifiedColumns[] = CeleryTasksPeer::TASK_ID;
}
return $this;
} // setDbTaskId()
/**
* Set the value of [track_reference] column.
*
@ -306,11 +344,12 @@ abstract class BaseCeleryTasks extends BaseObject implements Persistent
{
try {
$this->id = ($row[$startcol + 0] !== null) ? (string) $row[$startcol + 0] : null;
$this->track_reference = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null;
$this->name = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null;
$this->dispatch_time = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null;
$this->status = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null;
$this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null;
$this->task_id = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null;
$this->track_reference = ($row[$startcol + 2] !== null) ? (int) $row[$startcol + 2] : null;
$this->name = ($row[$startcol + 3] !== null) ? (string) $row[$startcol + 3] : null;
$this->dispatch_time = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null;
$this->status = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null;
$this->resetModified();
$this->setNew(false);
@ -320,7 +359,7 @@ abstract class BaseCeleryTasks extends BaseObject implements Persistent
}
$this->postHydrate($row, $startcol, $rehydrate);
return $startcol + 5; // 5 = CeleryTasksPeer::NUM_HYDRATE_COLUMNS.
return $startcol + 6; // 6 = CeleryTasksPeer::NUM_HYDRATE_COLUMNS.
} catch (Exception $e) {
throw new PropelException("Error populating CeleryTasks object", $e);
@ -542,11 +581,28 @@ abstract class BaseCeleryTasks extends BaseObject implements Persistent
$modifiedColumns = array();
$index = 0;
$this->modifiedColumns[] = CeleryTasksPeer::ID;
if (null !== $this->id) {
throw new PropelException('Cannot insert a value for auto-increment primary key (' . CeleryTasksPeer::ID . ')');
}
if (null === $this->id) {
try {
$stmt = $con->query("SELECT nextval('celery_tasks_id_seq')");
$row = $stmt->fetch(PDO::FETCH_NUM);
$this->id = $row[0];
} catch (Exception $e) {
throw new PropelException('Unable to get sequence id.', $e);
}
}
// check the columns in natural order for more readable SQL queries
if ($this->isColumnModified(CeleryTasksPeer::ID)) {
$modifiedColumns[':p' . $index++] = '"id"';
}
if ($this->isColumnModified(CeleryTasksPeer::TASK_ID)) {
$modifiedColumns[':p' . $index++] = '"task_id"';
}
if ($this->isColumnModified(CeleryTasksPeer::TRACK_REFERENCE)) {
$modifiedColumns[':p' . $index++] = '"track_reference"';
}
@ -571,7 +627,10 @@ abstract class BaseCeleryTasks extends BaseObject implements Persistent
foreach ($modifiedColumns as $identifier => $columnName) {
switch ($columnName) {
case '"id"':
$stmt->bindValue($identifier, $this->id, PDO::PARAM_STR);
$stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
break;
case '"task_id"':
$stmt->bindValue($identifier, $this->task_id, PDO::PARAM_STR);
break;
case '"track_reference"':
$stmt->bindValue($identifier, $this->track_reference, PDO::PARAM_INT);
@ -728,15 +787,18 @@ abstract class BaseCeleryTasks extends BaseObject implements Persistent
return $this->getDbId();
break;
case 1:
return $this->getDbTrackReference();
return $this->getDbTaskId();
break;
case 2:
return $this->getDbName();
return $this->getDbTrackReference();
break;
case 3:
return $this->getDbDispatchTime();
return $this->getDbName();
break;
case 4:
return $this->getDbDispatchTime();
break;
case 5:
return $this->getDbStatus();
break;
default:
@ -769,10 +831,11 @@ abstract class BaseCeleryTasks extends BaseObject implements Persistent
$keys = CeleryTasksPeer::getFieldNames($keyType);
$result = array(
$keys[0] => $this->getDbId(),
$keys[1] => $this->getDbTrackReference(),
$keys[2] => $this->getDbName(),
$keys[3] => $this->getDbDispatchTime(),
$keys[4] => $this->getDbStatus(),
$keys[1] => $this->getDbTaskId(),
$keys[2] => $this->getDbTrackReference(),
$keys[3] => $this->getDbName(),
$keys[4] => $this->getDbDispatchTime(),
$keys[5] => $this->getDbStatus(),
);
$virtualColumns = $this->virtualColumns;
foreach ($virtualColumns as $key => $virtualColumn) {
@ -821,15 +884,18 @@ abstract class BaseCeleryTasks extends BaseObject implements Persistent
$this->setDbId($value);
break;
case 1:
$this->setDbTrackReference($value);
$this->setDbTaskId($value);
break;
case 2:
$this->setDbName($value);
$this->setDbTrackReference($value);
break;
case 3:
$this->setDbDispatchTime($value);
$this->setDbName($value);
break;
case 4:
$this->setDbDispatchTime($value);
break;
case 5:
$this->setDbStatus($value);
break;
} // switch()
@ -857,10 +923,11 @@ abstract class BaseCeleryTasks extends BaseObject implements Persistent
$keys = CeleryTasksPeer::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) $this->setDbId($arr[$keys[0]]);
if (array_key_exists($keys[1], $arr)) $this->setDbTrackReference($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setDbName($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setDbDispatchTime($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setDbStatus($arr[$keys[4]]);
if (array_key_exists($keys[1], $arr)) $this->setDbTaskId($arr[$keys[1]]);
if (array_key_exists($keys[2], $arr)) $this->setDbTrackReference($arr[$keys[2]]);
if (array_key_exists($keys[3], $arr)) $this->setDbName($arr[$keys[3]]);
if (array_key_exists($keys[4], $arr)) $this->setDbDispatchTime($arr[$keys[4]]);
if (array_key_exists($keys[5], $arr)) $this->setDbStatus($arr[$keys[5]]);
}
/**
@ -873,6 +940,7 @@ abstract class BaseCeleryTasks extends BaseObject implements Persistent
$criteria = new Criteria(CeleryTasksPeer::DATABASE_NAME);
if ($this->isColumnModified(CeleryTasksPeer::ID)) $criteria->add(CeleryTasksPeer::ID, $this->id);
if ($this->isColumnModified(CeleryTasksPeer::TASK_ID)) $criteria->add(CeleryTasksPeer::TASK_ID, $this->task_id);
if ($this->isColumnModified(CeleryTasksPeer::TRACK_REFERENCE)) $criteria->add(CeleryTasksPeer::TRACK_REFERENCE, $this->track_reference);
if ($this->isColumnModified(CeleryTasksPeer::NAME)) $criteria->add(CeleryTasksPeer::NAME, $this->name);
if ($this->isColumnModified(CeleryTasksPeer::DISPATCH_TIME)) $criteria->add(CeleryTasksPeer::DISPATCH_TIME, $this->dispatch_time);
@ -899,7 +967,7 @@ abstract class BaseCeleryTasks extends BaseObject implements Persistent
/**
* Returns the primary key for this object (row).
* @return string
* @return int
*/
public function getPrimaryKey()
{
@ -909,7 +977,7 @@ abstract class BaseCeleryTasks extends BaseObject implements Persistent
/**
* Generic method to set the primary key (id column).
*
* @param string $key Primary key.
* @param int $key Primary key.
* @return void
*/
public function setPrimaryKey($key)
@ -940,6 +1008,7 @@ abstract class BaseCeleryTasks extends BaseObject implements Persistent
*/
public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
{
$copyObj->setDbTaskId($this->getDbTaskId());
$copyObj->setDbTrackReference($this->getDbTrackReference());
$copyObj->setDbName($this->getDbName());
$copyObj->setDbDispatchTime($this->getDbDispatchTime());
@ -1060,6 +1129,7 @@ abstract class BaseCeleryTasks extends BaseObject implements Persistent
public function clear()
{
$this->id = null;
$this->task_id = null;
$this->track_reference = null;
$this->name = null;
$this->dispatch_time = null;

View file

@ -24,17 +24,20 @@ abstract class BaseCeleryTasksPeer
const TM_CLASS = 'CeleryTasksTableMap';
/** The total number of columns. */
const NUM_COLUMNS = 5;
const NUM_COLUMNS = 6;
/** The number of lazy-loaded columns. */
const NUM_LAZY_LOAD_COLUMNS = 0;
/** The number of columns to hydrate (NUM_COLUMNS - NUM_LAZY_LOAD_COLUMNS) */
const NUM_HYDRATE_COLUMNS = 5;
const NUM_HYDRATE_COLUMNS = 6;
/** the column name for the id field */
const ID = 'celery_tasks.id';
/** the column name for the task_id field */
const TASK_ID = 'celery_tasks.task_id';
/** the column name for the track_reference field */
const TRACK_REFERENCE = 'celery_tasks.track_reference';
@ -66,12 +69,12 @@ abstract class BaseCeleryTasksPeer
* e.g. CeleryTasksPeer::$fieldNames[CeleryTasksPeer::TYPE_PHPNAME][0] = 'Id'
*/
protected static $fieldNames = array (
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbTrackReference', 'DbName', 'DbDispatchTime', 'DbStatus', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbTrackReference', 'dbName', 'dbDispatchTime', 'dbStatus', ),
BasePeer::TYPE_COLNAME => array (CeleryTasksPeer::ID, CeleryTasksPeer::TRACK_REFERENCE, CeleryTasksPeer::NAME, CeleryTasksPeer::DISPATCH_TIME, CeleryTasksPeer::STATUS, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'TRACK_REFERENCE', 'NAME', 'DISPATCH_TIME', 'STATUS', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'track_reference', 'name', 'dispatch_time', 'status', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
BasePeer::TYPE_PHPNAME => array ('DbId', 'DbTaskId', 'DbTrackReference', 'DbName', 'DbDispatchTime', 'DbStatus', ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId', 'dbTaskId', 'dbTrackReference', 'dbName', 'dbDispatchTime', 'dbStatus', ),
BasePeer::TYPE_COLNAME => array (CeleryTasksPeer::ID, CeleryTasksPeer::TASK_ID, CeleryTasksPeer::TRACK_REFERENCE, CeleryTasksPeer::NAME, CeleryTasksPeer::DISPATCH_TIME, CeleryTasksPeer::STATUS, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID', 'TASK_ID', 'TRACK_REFERENCE', 'NAME', 'DISPATCH_TIME', 'STATUS', ),
BasePeer::TYPE_FIELDNAME => array ('id', 'task_id', 'track_reference', 'name', 'dispatch_time', 'status', ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, )
);
/**
@ -81,12 +84,12 @@ abstract class BaseCeleryTasksPeer
* e.g. CeleryTasksPeer::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
*/
protected static $fieldKeys = array (
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbTrackReference' => 1, 'DbName' => 2, 'DbDispatchTime' => 3, 'DbStatus' => 4, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbTrackReference' => 1, 'dbName' => 2, 'dbDispatchTime' => 3, 'dbStatus' => 4, ),
BasePeer::TYPE_COLNAME => array (CeleryTasksPeer::ID => 0, CeleryTasksPeer::TRACK_REFERENCE => 1, CeleryTasksPeer::NAME => 2, CeleryTasksPeer::DISPATCH_TIME => 3, CeleryTasksPeer::STATUS => 4, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'TRACK_REFERENCE' => 1, 'NAME' => 2, 'DISPATCH_TIME' => 3, 'STATUS' => 4, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'track_reference' => 1, 'name' => 2, 'dispatch_time' => 3, 'status' => 4, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
BasePeer::TYPE_PHPNAME => array ('DbId' => 0, 'DbTaskId' => 1, 'DbTrackReference' => 2, 'DbName' => 3, 'DbDispatchTime' => 4, 'DbStatus' => 5, ),
BasePeer::TYPE_STUDLYPHPNAME => array ('dbId' => 0, 'dbTaskId' => 1, 'dbTrackReference' => 2, 'dbName' => 3, 'dbDispatchTime' => 4, 'dbStatus' => 5, ),
BasePeer::TYPE_COLNAME => array (CeleryTasksPeer::ID => 0, CeleryTasksPeer::TASK_ID => 1, CeleryTasksPeer::TRACK_REFERENCE => 2, CeleryTasksPeer::NAME => 3, CeleryTasksPeer::DISPATCH_TIME => 4, CeleryTasksPeer::STATUS => 5, ),
BasePeer::TYPE_RAW_COLNAME => array ('ID' => 0, 'TASK_ID' => 1, 'TRACK_REFERENCE' => 2, 'NAME' => 3, 'DISPATCH_TIME' => 4, 'STATUS' => 5, ),
BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'task_id' => 1, 'track_reference' => 2, 'name' => 3, 'dispatch_time' => 4, 'status' => 5, ),
BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, )
);
/**
@ -161,12 +164,14 @@ abstract class BaseCeleryTasksPeer
{
if (null === $alias) {
$criteria->addSelectColumn(CeleryTasksPeer::ID);
$criteria->addSelectColumn(CeleryTasksPeer::TASK_ID);
$criteria->addSelectColumn(CeleryTasksPeer::TRACK_REFERENCE);
$criteria->addSelectColumn(CeleryTasksPeer::NAME);
$criteria->addSelectColumn(CeleryTasksPeer::DISPATCH_TIME);
$criteria->addSelectColumn(CeleryTasksPeer::STATUS);
} else {
$criteria->addSelectColumn($alias . '.id');
$criteria->addSelectColumn($alias . '.task_id');
$criteria->addSelectColumn($alias . '.track_reference');
$criteria->addSelectColumn($alias . '.name');
$criteria->addSelectColumn($alias . '.dispatch_time');
@ -409,7 +414,7 @@ abstract class BaseCeleryTasksPeer
public static function getPrimaryKeyFromRow($row, $startcol = 0)
{
return (string) $row[$startcol];
return (int) $row[$startcol];
}
/**
@ -764,6 +769,10 @@ abstract class BaseCeleryTasksPeer
$criteria = $values->buildCriteria(); // build Criteria from CeleryTasks object
}
if ($criteria->containsKey(CeleryTasksPeer::ID) && $criteria->keyContainsValue(CeleryTasksPeer::ID) ) {
throw new PropelException('Cannot insert a value for auto-increment primary key ('.CeleryTasksPeer::ID.')');
}
// Set the correct dbName
$criteria->setDbName(CeleryTasksPeer::DATABASE_NAME);
@ -952,7 +961,7 @@ abstract class BaseCeleryTasksPeer
/**
* Retrieve a single object by pkey.
*
* @param string $pk the primary key.
* @param int $pk the primary key.
* @param PropelPDO $con the connection to use
* @return CeleryTasks
*/

View file

@ -7,12 +7,14 @@
*
*
* @method CeleryTasksQuery orderByDbId($order = Criteria::ASC) Order by the id column
* @method CeleryTasksQuery orderByDbTaskId($order = Criteria::ASC) Order by the task_id column
* @method CeleryTasksQuery orderByDbTrackReference($order = Criteria::ASC) Order by the track_reference column
* @method CeleryTasksQuery orderByDbName($order = Criteria::ASC) Order by the name column
* @method CeleryTasksQuery orderByDbDispatchTime($order = Criteria::ASC) Order by the dispatch_time column
* @method CeleryTasksQuery orderByDbStatus($order = Criteria::ASC) Order by the status column
*
* @method CeleryTasksQuery groupByDbId() Group by the id column
* @method CeleryTasksQuery groupByDbTaskId() Group by the task_id column
* @method CeleryTasksQuery groupByDbTrackReference() Group by the track_reference column
* @method CeleryTasksQuery groupByDbName() Group by the name column
* @method CeleryTasksQuery groupByDbDispatchTime() Group by the dispatch_time column
@ -29,12 +31,14 @@
* @method CeleryTasks findOne(PropelPDO $con = null) Return the first CeleryTasks matching the query
* @method CeleryTasks findOneOrCreate(PropelPDO $con = null) Return the first CeleryTasks matching the query, or a new CeleryTasks object populated from the query conditions when no match is found
*
* @method CeleryTasks findOneByDbTaskId(string $task_id) Return the first CeleryTasks filtered by the task_id column
* @method CeleryTasks findOneByDbTrackReference(int $track_reference) Return the first CeleryTasks filtered by the track_reference column
* @method CeleryTasks findOneByDbName(string $name) Return the first CeleryTasks filtered by the name column
* @method CeleryTasks findOneByDbDispatchTime(string $dispatch_time) Return the first CeleryTasks filtered by the dispatch_time column
* @method CeleryTasks findOneByDbStatus(string $status) Return the first CeleryTasks filtered by the status column
*
* @method array findByDbId(string $id) Return CeleryTasks objects filtered by the id column
* @method array findByDbId(int $id) Return CeleryTasks objects filtered by the id column
* @method array findByDbTaskId(string $task_id) Return CeleryTasks objects filtered by the task_id column
* @method array findByDbTrackReference(int $track_reference) Return CeleryTasks objects filtered by the track_reference column
* @method array findByDbName(string $name) Return CeleryTasks objects filtered by the name column
* @method array findByDbDispatchTime(string $dispatch_time) Return CeleryTasks objects filtered by the dispatch_time column
@ -146,10 +150,10 @@ abstract class BaseCeleryTasksQuery extends ModelCriteria
*/
protected function findPkSimple($key, $con)
{
$sql = 'SELECT "id", "track_reference", "name", "dispatch_time", "status" FROM "celery_tasks" WHERE "id" = :p0';
$sql = 'SELECT "id", "task_id", "track_reference", "name", "dispatch_time", "status" FROM "celery_tasks" WHERE "id" = :p0';
try {
$stmt = $con->prepare($sql);
$stmt->bindValue(':p0', $key, PDO::PARAM_STR);
$stmt->bindValue(':p0', $key, PDO::PARAM_INT);
$stmt->execute();
} catch (Exception $e) {
Propel::log($e->getMessage(), Propel::LOG_ERR);
@ -240,30 +244,72 @@ abstract class BaseCeleryTasksQuery extends ModelCriteria
*
* Example usage:
* <code>
* $query->filterByDbId('fooValue'); // WHERE id = 'fooValue'
* $query->filterByDbId('%fooValue%'); // WHERE id LIKE '%fooValue%'
* $query->filterByDbId(1234); // WHERE id = 1234
* $query->filterByDbId(array(12, 34)); // WHERE id IN (12, 34)
* $query->filterByDbId(array('min' => 12)); // WHERE id >= 12
* $query->filterByDbId(array('max' => 12)); // WHERE id <= 12
* </code>
*
* @param string $dbId The value to use as filter.
* Accepts wildcards (* and % trigger a LIKE)
* @param mixed $dbId The value to use as filter.
* Use scalar values for equality.
* Use array values for in_array() equivalent.
* Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
* @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
*
* @return CeleryTasksQuery The current query, for fluid interface
*/
public function filterByDbId($dbId = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($dbId)) {
if (is_array($dbId)) {
$useMinMax = false;
if (isset($dbId['min'])) {
$this->addUsingAlias(CeleryTasksPeer::ID, $dbId['min'], Criteria::GREATER_EQUAL);
$useMinMax = true;
}
if (isset($dbId['max'])) {
$this->addUsingAlias(CeleryTasksPeer::ID, $dbId['max'], Criteria::LESS_EQUAL);
$useMinMax = true;
}
if ($useMinMax) {
return $this;
}
if (null === $comparison) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $dbId)) {
$dbId = str_replace('*', '%', $dbId);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CeleryTasksPeer::ID, $dbId, $comparison);
}
/**
* Filter the query on the task_id column
*
* Example usage:
* <code>
* $query->filterByDbTaskId('fooValue'); // WHERE task_id = 'fooValue'
* $query->filterByDbTaskId('%fooValue%'); // WHERE task_id LIKE '%fooValue%'
* </code>
*
* @param string $dbTaskId 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 CeleryTasksQuery The current query, for fluid interface
*/
public function filterByDbTaskId($dbTaskId = null, $comparison = null)
{
if (null === $comparison) {
if (is_array($dbTaskId)) {
$comparison = Criteria::IN;
} elseif (preg_match('/[\%\*]/', $dbTaskId)) {
$dbTaskId = str_replace('*', '%', $dbTaskId);
$comparison = Criteria::LIKE;
}
}
return $this->addUsingAlias(CeleryTasksPeer::TASK_ID, $dbTaskId, $comparison);
}
/**
* Filter the query on the track_reference column
*