diff --git a/api/libretime_api/legacy/migrations/0033_3_0_0_alpha_13_7.py b/api/libretime_api/legacy/migrations/0033_3_0_0_alpha_13_7.py
new file mode 100644
index 000000000..c28853fbc
--- /dev/null
+++ b/api/libretime_api/legacy/migrations/0033_3_0_0_alpha_13_7.py
@@ -0,0 +1,44 @@
+# pylint: disable=invalid-name
+
+from django.db import migrations
+
+from ._migrations import legacy_migration_factory
+
+UP = """
+DROP TABLE IF EXISTS "cc_perms" CASCADE;
+"""
+
+DOWN = """
+CREATE TABLE "cc_perms"
+(
+ "permid" INTEGER NOT NULL,
+ "subj" INTEGER,
+ "action" VARCHAR(20),
+ "obj" INTEGER,
+ "type" CHAR(1),
+ PRIMARY KEY ("permid"),
+ CONSTRAINT "cc_perms_all_idx" UNIQUE ("subj","action","obj"),
+ CONSTRAINT "cc_perms_permid_idx" UNIQUE ("permid")
+);
+
+CREATE INDEX "cc_perms_subj_obj_idx" ON "cc_perms" ("subj","obj");
+
+ALTER TABLE "cc_perms" ADD CONSTRAINT "cc_perms_subj_fkey"
+ FOREIGN KEY ("subj")
+ REFERENCES "cc_subjs" ("id")
+ ON DELETE CASCADE;
+"""
+
+
+class Migration(migrations.Migration):
+ dependencies = [
+ ("legacy", "0032_3_0_0_alpha_13_6"),
+ ]
+ operations = [
+ migrations.RunPython(
+ code=legacy_migration_factory(
+ target="3.0.0-alpha.13.7",
+ sql=UP,
+ )
+ )
+ ]
diff --git a/api/libretime_api/legacy/migrations/__init__.py b/api/libretime_api/legacy/migrations/__init__.py
index 31d6d7213..3000100bb 100644
--- a/api/libretime_api/legacy/migrations/__init__.py
+++ b/api/libretime_api/legacy/migrations/__init__.py
@@ -1 +1 @@
-LEGACY_SCHEMA_VERSION = "3.0.0-alpha.13.6"
+LEGACY_SCHEMA_VERSION = "3.0.0-alpha.13.7"
diff --git a/api/libretime_api/legacy/migrations/sql/schema.sql b/api/libretime_api/legacy/migrations/sql/schema.sql
index 435bb8701..2440e01db 100644
--- a/api/libretime_api/legacy/migrations/sql/schema.sql
+++ b/api/libretime_api/legacy/migrations/sql/schema.sql
@@ -115,26 +115,6 @@ CREATE TABLE "cloud_file"
PRIMARY KEY ("id")
);
------------------------------------------------------------------------
--- cc_perms
------------------------------------------------------------------------
-
-DROP TABLE IF EXISTS "cc_perms" CASCADE;
-
-CREATE TABLE "cc_perms"
-(
- "permid" INTEGER NOT NULL,
- "subj" INTEGER,
- "action" VARCHAR(20),
- "obj" INTEGER,
- "type" CHAR(1),
- PRIMARY KEY ("permid"),
- CONSTRAINT "cc_perms_all_idx" UNIQUE ("subj","action","obj"),
- CONSTRAINT "cc_perms_permid_idx" UNIQUE ("permid")
-);
-
-CREATE INDEX "cc_perms_subj_obj_idx" ON "cc_perms" ("subj","obj");
-
-----------------------------------------------------------------------
-- cc_show
-----------------------------------------------------------------------
@@ -760,11 +740,6 @@ ALTER TABLE "cloud_file" ADD CONSTRAINT "cloud_file_FK_1"
REFERENCES "cc_files" ("id")
ON DELETE CASCADE;
-ALTER TABLE "cc_perms" ADD CONSTRAINT "cc_perms_subj_fkey"
- FOREIGN KEY ("subj")
- REFERENCES "cc_subjs" ("id")
- ON DELETE CASCADE;
-
ALTER TABLE "cc_show" ADD CONSTRAINT "cc_playlist_autoplaylist_fkey"
FOREIGN KEY ("autoplaylist_id")
REFERENCES "cc_playlist" ("id")
diff --git a/legacy/application/configs/classmap-airtime-conf.php b/legacy/application/configs/classmap-airtime-conf.php
index 1115fc022..4a90ddaab 100644
--- a/legacy/application/configs/classmap-airtime-conf.php
+++ b/legacy/application/configs/classmap-airtime-conf.php
@@ -29,9 +29,6 @@ return [
'BaseCcMountName' => 'airtime/om/BaseCcMountName.php',
'BaseCcMountNamePeer' => 'airtime/om/BaseCcMountNamePeer.php',
'BaseCcMountNameQuery' => 'airtime/om/BaseCcMountNameQuery.php',
- 'BaseCcPerms' => 'airtime/om/BaseCcPerms.php',
- 'BaseCcPermsPeer' => 'airtime/om/BaseCcPermsPeer.php',
- 'BaseCcPermsQuery' => 'airtime/om/BaseCcPermsQuery.php',
'BaseCcPlaylist' => 'airtime/om/BaseCcPlaylist.php',
'BaseCcPlaylistPeer' => 'airtime/om/BaseCcPlaylistPeer.php',
'BaseCcPlaylistQuery' => 'airtime/om/BaseCcPlaylistQuery.php',
@@ -152,10 +149,6 @@ return [
'CcMountNamePeer' => 'airtime/CcMountNamePeer.php',
'CcMountNameQuery' => 'airtime/CcMountNameQuery.php',
'CcMountNameTableMap' => 'airtime/map/CcMountNameTableMap.php',
- 'CcPerms' => 'airtime/CcPerms.php',
- 'CcPermsPeer' => 'airtime/CcPermsPeer.php',
- 'CcPermsQuery' => 'airtime/CcPermsQuery.php',
- 'CcPermsTableMap' => 'airtime/map/CcPermsTableMap.php',
'CcPlaylist' => 'airtime/CcPlaylist.php',
'CcPlaylistPeer' => 'airtime/CcPlaylistPeer.php',
'CcPlaylistQuery' => 'airtime/CcPlaylistQuery.php',
diff --git a/legacy/application/models/airtime/CcPerms.php b/legacy/application/models/airtime/CcPerms.php
deleted file mode 100644
index 5fe407dbb..000000000
--- a/legacy/application/models/airtime/CcPerms.php
+++ /dev/null
@@ -1,12 +0,0 @@
-setName('cc_perms');
- $this->setPhpName('CcPerms');
- $this->setClassname('CcPerms');
- $this->setPackage('airtime');
- $this->setUseIdGenerator(false);
- // columns
- $this->addPrimaryKey('permid', 'Permid', 'INTEGER', true, null, null);
- $this->addForeignKey('subj', 'Subj', 'INTEGER', 'cc_subjs', 'id', false, null, null);
- $this->addColumn('action', 'Action', 'VARCHAR', false, 20, null);
- $this->addColumn('obj', 'Obj', 'INTEGER', false, null, null);
- $this->addColumn('type', 'Type', 'CHAR', false, 1, null);
- // validators
- } // initialize()
-
- /**
- * Build the RelationMap objects for this table relationships
- */
- public function buildRelations()
- {
- $this->addRelation('CcSubjs', 'CcSubjs', RelationMap::MANY_TO_ONE, array('subj' => 'id', ), 'CASCADE', null);
- } // buildRelations()
-
-} // CcPermsTableMap
diff --git a/legacy/application/models/airtime/map/CcSubjsTableMap.php b/legacy/application/models/airtime/map/CcSubjsTableMap.php
index bdb4e387a..050f9109a 100644
--- a/legacy/application/models/airtime/map/CcSubjsTableMap.php
+++ b/legacy/application/models/airtime/map/CcSubjsTableMap.php
@@ -62,7 +62,6 @@ class CcSubjsTableMap extends TableMap
{
$this->addRelation('CcFilesRelatedByDbOwnerId', 'CcFiles', RelationMap::ONE_TO_MANY, array('id' => 'owner_id', ), null, null, 'CcFilessRelatedByDbOwnerId');
$this->addRelation('CcFilesRelatedByDbEditedby', 'CcFiles', RelationMap::ONE_TO_MANY, array('id' => 'editedby', ), null, null, 'CcFilessRelatedByDbEditedby');
- $this->addRelation('CcPerms', 'CcPerms', RelationMap::ONE_TO_MANY, array('id' => 'subj', ), 'CASCADE', null, 'CcPermss');
$this->addRelation('CcShowHosts', 'CcShowHosts', RelationMap::ONE_TO_MANY, array('id' => 'subjs_id', ), 'CASCADE', null, 'CcShowHostss');
$this->addRelation('CcPlaylist', 'CcPlaylist', RelationMap::ONE_TO_MANY, array('id' => 'creator_id', ), 'CASCADE', null, 'CcPlaylists');
$this->addRelation('CcBlock', 'CcBlock', RelationMap::ONE_TO_MANY, array('id' => 'creator_id', ), 'CASCADE', null, 'CcBlocks');
diff --git a/legacy/application/models/airtime/om/BaseCcPerms.php b/legacy/application/models/airtime/om/BaseCcPerms.php
deleted file mode 100644
index ab3d0b120..000000000
--- a/legacy/application/models/airtime/om/BaseCcPerms.php
+++ /dev/null
@@ -1,1093 +0,0 @@
-permid;
- }
-
- /**
- * Get the [subj] column value.
- *
- * @return int
- */
- public function getSubj()
- {
-
- return $this->subj;
- }
-
- /**
- * Get the [action] column value.
- *
- * @return string
- */
- public function getAction()
- {
-
- return $this->action;
- }
-
- /**
- * Get the [obj] column value.
- *
- * @return int
- */
- public function getObj()
- {
-
- return $this->obj;
- }
-
- /**
- * Get the [type] column value.
- *
- * @return string
- */
- public function getType()
- {
-
- return $this->type;
- }
-
- /**
- * Set the value of [permid] column.
- *
- * @param int $v new value
- * @return CcPerms The current object (for fluent API support)
- */
- public function setPermid($v)
- {
- if ($v !== null && is_numeric($v)) {
- $v = (int) $v;
- }
-
- if ($this->permid !== $v) {
- $this->permid = $v;
- $this->modifiedColumns[] = CcPermsPeer::PERMID;
- }
-
-
- return $this;
- } // setPermid()
-
- /**
- * Set the value of [subj] column.
- *
- * @param int $v new value
- * @return CcPerms The current object (for fluent API support)
- */
- public function setSubj($v)
- {
- if ($v !== null && is_numeric($v)) {
- $v = (int) $v;
- }
-
- if ($this->subj !== $v) {
- $this->subj = $v;
- $this->modifiedColumns[] = CcPermsPeer::SUBJ;
- }
-
- if ($this->aCcSubjs !== null && $this->aCcSubjs->getDbId() !== $v) {
- $this->aCcSubjs = null;
- }
-
-
- return $this;
- } // setSubj()
-
- /**
- * Set the value of [action] column.
- *
- * @param string $v new value
- * @return CcPerms The current object (for fluent API support)
- */
- public function setAction($v)
- {
- if ($v !== null) {
- $v = (string) $v;
- }
-
- if ($this->action !== $v) {
- $this->action = $v;
- $this->modifiedColumns[] = CcPermsPeer::ACTION;
- }
-
-
- return $this;
- } // setAction()
-
- /**
- * Set the value of [obj] column.
- *
- * @param int $v new value
- * @return CcPerms The current object (for fluent API support)
- */
- public function setObj($v)
- {
- if ($v !== null && is_numeric($v)) {
- $v = (int) $v;
- }
-
- if ($this->obj !== $v) {
- $this->obj = $v;
- $this->modifiedColumns[] = CcPermsPeer::OBJ;
- }
-
-
- return $this;
- } // setObj()
-
- /**
- * Set the value of [type] column.
- *
- * @param string $v new value
- * @return CcPerms The current object (for fluent API support)
- */
- public function setType($v)
- {
- if ($v !== null) {
- $v = (string) $v;
- }
-
- if ($this->type !== $v) {
- $this->type = $v;
- $this->modifiedColumns[] = CcPermsPeer::TYPE;
- }
-
-
- return $this;
- } // setType()
-
- /**
- * Indicates whether the columns in this object are only set to default values.
- *
- * This method can be used in conjunction with isModified() to indicate whether an object is both
- * modified _and_ has some values set which are non-default.
- *
- * @return boolean Whether the columns in this object are only been set with default values.
- */
- public function hasOnlyDefaultValues()
- {
- // otherwise, everything was equal, so return true
- return true;
- } // hasOnlyDefaultValues()
-
- /**
- * Hydrates (populates) the object variables with values from the database resultset.
- *
- * An offset (0-based "start column") is specified so that objects can be hydrated
- * with a subset of the columns in the resultset rows. This is needed, for example,
- * for results of JOIN queries where the resultset row includes columns from two or
- * more tables.
- *
- * @param array $row The row returned by PDOStatement->fetch(PDO::FETCH_NUM)
- * @param int $startcol 0-based offset column which indicates which resultset column to start with.
- * @param boolean $rehydrate Whether this object is being re-hydrated from the database.
- * @return int next starting column
- * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
- */
- public function hydrate($row, $startcol = 0, $rehydrate = false)
- {
- try {
-
- $this->permid = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null;
- $this->subj = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null;
- $this->action = ($row[$startcol + 2] !== null) ? (string) $row[$startcol + 2] : null;
- $this->obj = ($row[$startcol + 3] !== null) ? (int) $row[$startcol + 3] : null;
- $this->type = ($row[$startcol + 4] !== null) ? (string) $row[$startcol + 4] : null;
- $this->resetModified();
-
- $this->setNew(false);
-
- if ($rehydrate) {
- $this->ensureConsistency();
- }
- $this->postHydrate($row, $startcol, $rehydrate);
-
- return $startcol + 5; // 5 = CcPermsPeer::NUM_HYDRATE_COLUMNS.
-
- } catch (Exception $e) {
- throw new PropelException("Error populating CcPerms object", $e);
- }
- }
-
- /**
- * Checks and repairs the internal consistency of the object.
- *
- * This method is executed after an already-instantiated object is re-hydrated
- * from the database. It exists to check any foreign keys to make sure that
- * the objects related to the current object are correct based on foreign key.
- *
- * You can override this method in the stub class, but you should always invoke
- * the base method from the overridden method (i.e. parent::ensureConsistency()),
- * in case your model changes.
- *
- * @throws PropelException
- */
- public function ensureConsistency()
- {
-
- if ($this->aCcSubjs !== null && $this->subj !== $this->aCcSubjs->getDbId()) {
- $this->aCcSubjs = null;
- }
- } // ensureConsistency
-
- /**
- * Reloads this object from datastore based on primary key and (optionally) resets all associated objects.
- *
- * This will only work if the object has been saved and has a valid primary key set.
- *
- * @param boolean $deep (optional) Whether to also de-associated any related objects.
- * @param PropelPDO $con (optional) The PropelPDO connection to use.
- * @return void
- * @throws PropelException - if this object is deleted, unsaved or doesn't have pk match in db
- */
- public function reload($deep = false, PropelPDO $con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("Cannot reload a deleted object.");
- }
-
- if ($this->isNew()) {
- throw new PropelException("Cannot reload an unsaved object.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_READ);
- }
-
- // We don't need to alter the object instance pool; we're just modifying this instance
- // already in the pool.
-
- $stmt = CcPermsPeer::doSelectStmt($this->buildPkeyCriteria(), $con);
- $row = $stmt->fetch(PDO::FETCH_NUM);
- $stmt->closeCursor();
- if (!$row) {
- throw new PropelException('Cannot find matching row in the database to reload object values.');
- }
- $this->hydrate($row, 0, true); // rehydrate
-
- if ($deep) { // also de-associate any related objects?
-
- $this->aCcSubjs = null;
- } // if (deep)
- }
-
- /**
- * Removes this object from datastore and sets delete attribute.
- *
- * @param PropelPDO $con
- * @return void
- * @throws PropelException
- * @throws Exception
- * @see BaseObject::setDeleted()
- * @see BaseObject::isDeleted()
- */
- public function delete(PropelPDO $con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("This object has already been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
- }
-
- $con->beginTransaction();
- try {
- $deleteQuery = CcPermsQuery::create()
- ->filterByPrimaryKey($this->getPrimaryKey());
- $ret = $this->preDelete($con);
- if ($ret) {
- $deleteQuery->delete($con);
- $this->postDelete($con);
- $con->commit();
- $this->setDeleted(true);
- } else {
- $con->commit();
- }
- } catch (Exception $e) {
- $con->rollBack();
- throw $e;
- }
- }
-
- /**
- * Persists this object to the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All modified related objects will also be persisted in the doSave()
- * method. This method wraps all precipitate database operations in a
- * single transaction.
- *
- * @param PropelPDO $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @throws Exception
- * @see doSave()
- */
- public function save(PropelPDO $con = null)
- {
- if ($this->isDeleted()) {
- throw new PropelException("You cannot save an object that has been deleted.");
- }
-
- if ($con === null) {
- $con = Propel::getConnection(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
- }
-
- $con->beginTransaction();
- $isInsert = $this->isNew();
- try {
- $ret = $this->preSave($con);
- if ($isInsert) {
- $ret = $ret && $this->preInsert($con);
- } else {
- $ret = $ret && $this->preUpdate($con);
- }
- if ($ret) {
- $affectedRows = $this->doSave($con);
- if ($isInsert) {
- $this->postInsert($con);
- } else {
- $this->postUpdate($con);
- }
- $this->postSave($con);
- CcPermsPeer::addInstanceToPool($this);
- } else {
- $affectedRows = 0;
- }
- $con->commit();
-
- return $affectedRows;
- } catch (Exception $e) {
- $con->rollBack();
- throw $e;
- }
- }
-
- /**
- * Performs the work of inserting or updating the row in the database.
- *
- * If the object is new, it inserts it; otherwise an update is performed.
- * All related objects are also updated in this method.
- *
- * @param PropelPDO $con
- * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
- * @throws PropelException
- * @see save()
- */
- protected function doSave(PropelPDO $con)
- {
- $affectedRows = 0; // initialize var to track total num of affected rows
- if (!$this->alreadyInSave) {
- $this->alreadyInSave = true;
-
- // We call the save method on the following object(s) if they
- // were passed to this object by their corresponding set
- // method. This object relates to these object(s) by a
- // foreign key reference.
-
- if ($this->aCcSubjs !== null) {
- if ($this->aCcSubjs->isModified() || $this->aCcSubjs->isNew()) {
- $affectedRows += $this->aCcSubjs->save($con);
- }
- $this->setCcSubjs($this->aCcSubjs);
- }
-
- if ($this->isNew() || $this->isModified()) {
- // persist changes
- if ($this->isNew()) {
- $this->doInsert($con);
- } else {
- $this->doUpdate($con);
- }
- $affectedRows += 1;
- $this->resetModified();
- }
-
- $this->alreadyInSave = false;
-
- }
-
- return $affectedRows;
- } // doSave()
-
- /**
- * Insert the row in the database.
- *
- * @param PropelPDO $con
- *
- * @throws PropelException
- * @see doSave()
- */
- protected function doInsert(PropelPDO $con)
- {
- $modifiedColumns = array();
- $index = 0;
-
-
- // check the columns in natural order for more readable SQL queries
- if ($this->isColumnModified(CcPermsPeer::PERMID)) {
- $modifiedColumns[':p' . $index++] = '"permid"';
- }
- if ($this->isColumnModified(CcPermsPeer::SUBJ)) {
- $modifiedColumns[':p' . $index++] = '"subj"';
- }
- if ($this->isColumnModified(CcPermsPeer::ACTION)) {
- $modifiedColumns[':p' . $index++] = '"action"';
- }
- if ($this->isColumnModified(CcPermsPeer::OBJ)) {
- $modifiedColumns[':p' . $index++] = '"obj"';
- }
- if ($this->isColumnModified(CcPermsPeer::TYPE)) {
- $modifiedColumns[':p' . $index++] = '"type"';
- }
-
- $sql = sprintf(
- 'INSERT INTO "cc_perms" (%s) VALUES (%s)',
- implode(', ', $modifiedColumns),
- implode(', ', array_keys($modifiedColumns))
- );
-
- try {
- $stmt = $con->prepare($sql);
- foreach ($modifiedColumns as $identifier => $columnName) {
- switch ($columnName) {
- case '"permid"':
- $stmt->bindValue($identifier, $this->permid, PDO::PARAM_INT);
- break;
- case '"subj"':
- $stmt->bindValue($identifier, $this->subj, PDO::PARAM_INT);
- break;
- case '"action"':
- $stmt->bindValue($identifier, $this->action, PDO::PARAM_STR);
- break;
- case '"obj"':
- $stmt->bindValue($identifier, $this->obj, PDO::PARAM_INT);
- break;
- case '"type"':
- $stmt->bindValue($identifier, $this->type, PDO::PARAM_STR);
- break;
- }
- }
- $stmt->execute();
- } catch (Exception $e) {
- Propel::log($e->getMessage(), Propel::LOG_ERR);
- throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e);
- }
-
- $this->setNew(false);
- }
-
- /**
- * Update the row in the database.
- *
- * @param PropelPDO $con
- *
- * @see doSave()
- */
- protected function doUpdate(PropelPDO $con)
- {
- $selectCriteria = $this->buildPkeyCriteria();
- $valuesCriteria = $this->buildCriteria();
- BasePeer::doUpdate($selectCriteria, $valuesCriteria, $con);
- }
-
- /**
- * Array of ValidationFailed objects.
- * @var array ValidationFailed[]
- */
- protected $validationFailures = array();
-
- /**
- * Gets any ValidationFailed objects that resulted from last call to validate().
- *
- *
- * @return array ValidationFailed[]
- * @see validate()
- */
- public function getValidationFailures()
- {
- return $this->validationFailures;
- }
-
- /**
- * Validates the objects modified field values and all objects related to this table.
- *
- * If $columns is either a column name or an array of column names
- * only those columns are validated.
- *
- * @param mixed $columns Column name or an array of column names.
- * @return boolean Whether all columns pass validation.
- * @see doValidate()
- * @see getValidationFailures()
- */
- public function validate($columns = null)
- {
- $res = $this->doValidate($columns);
- if ($res === true) {
- $this->validationFailures = array();
-
- return true;
- }
-
- $this->validationFailures = $res;
-
- return false;
- }
-
- /**
- * This function performs the validation work for complex object models.
- *
- * In addition to checking the current object, all related objects will
- * also be validated. If all pass then true is returned; otherwise
- * an aggregated array of ValidationFailed objects will be returned.
- *
- * @param array $columns Array of column names to validate.
- * @return mixed true if all validations pass; array of ValidationFailed objects otherwise.
- */
- protected function doValidate($columns = null)
- {
- if (!$this->alreadyInValidation) {
- $this->alreadyInValidation = true;
- $retval = null;
-
- $failureMap = array();
-
-
- // We call the validate method on the following object(s) if they
- // were passed to this object by their corresponding set
- // method. This object relates to these object(s) by a
- // foreign key reference.
-
- if ($this->aCcSubjs !== null) {
- if (!$this->aCcSubjs->validate($columns)) {
- $failureMap = array_merge($failureMap, $this->aCcSubjs->getValidationFailures());
- }
- }
-
-
- if (($retval = CcPermsPeer::doValidate($this, $columns)) !== true) {
- $failureMap = array_merge($failureMap, $retval);
- }
-
-
-
- $this->alreadyInValidation = false;
- }
-
- return (!empty($failureMap) ? $failureMap : true);
- }
-
- /**
- * Retrieves a field from the object by name passed in as a string.
- *
- * @param string $name name
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
- * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
- * Defaults to BasePeer::TYPE_PHPNAME
- * @return mixed Value of field.
- */
- public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = CcPermsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
- $field = $this->getByPosition($pos);
-
- return $field;
- }
-
- /**
- * Retrieves a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @return mixed Value of field at $pos
- */
- public function getByPosition($pos)
- {
- switch ($pos) {
- case 0:
- return $this->getPermid();
- break;
- case 1:
- return $this->getSubj();
- break;
- case 2:
- return $this->getAction();
- break;
- case 3:
- return $this->getObj();
- break;
- case 4:
- return $this->getType();
- break;
- default:
- return null;
- break;
- } // switch()
- }
-
- /**
- * Exports the object as an array.
- *
- * You can specify the key type of the array by passing one of the class
- * type constants.
- *
- * @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
- * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
- * Defaults to BasePeer::TYPE_PHPNAME.
- * @param boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to true.
- * @param array $alreadyDumpedObjects List of objects to skip to avoid recursion
- * @param boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE.
- *
- * @return array an associative array containing the field names (as keys) and field values
- */
- public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
- {
- if (isset($alreadyDumpedObjects['CcPerms'][$this->getPrimaryKey()])) {
- return '*RECURSION*';
- }
- $alreadyDumpedObjects['CcPerms'][$this->getPrimaryKey()] = true;
- $keys = CcPermsPeer::getFieldNames($keyType);
- $result = array(
- $keys[0] => $this->getPermid(),
- $keys[1] => $this->getSubj(),
- $keys[2] => $this->getAction(),
- $keys[3] => $this->getObj(),
- $keys[4] => $this->getType(),
- );
- $virtualColumns = $this->virtualColumns;
- foreach ($virtualColumns as $key => $virtualColumn) {
- $result[$key] = $virtualColumn;
- }
-
- if ($includeForeignObjects) {
- if (null !== $this->aCcSubjs) {
- $result['CcSubjs'] = $this->aCcSubjs->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
- }
- }
-
- return $result;
- }
-
- /**
- * Sets a field from the object by name passed in as a string.
- *
- * @param string $name peer name
- * @param mixed $value field value
- * @param string $type The type of fieldname the $name is of:
- * one of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
- * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
- * Defaults to BasePeer::TYPE_PHPNAME
- * @return void
- */
- public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
- {
- $pos = CcPermsPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
-
- $this->setByPosition($pos, $value);
- }
-
- /**
- * Sets a field from the object by Position as specified in the xml schema.
- * Zero-based.
- *
- * @param int $pos position in xml schema
- * @param mixed $value field value
- * @return void
- */
- public function setByPosition($pos, $value)
- {
- switch ($pos) {
- case 0:
- $this->setPermid($value);
- break;
- case 1:
- $this->setSubj($value);
- break;
- case 2:
- $this->setAction($value);
- break;
- case 3:
- $this->setObj($value);
- break;
- case 4:
- $this->setType($value);
- break;
- } // switch()
- }
-
- /**
- * Populates the object using an array.
- *
- * This is particularly useful when populating an object from one of the
- * request arrays (e.g. $_POST). This method goes through the column
- * names, checking to see whether a matching key exists in populated
- * array. If so the setByName() method is called for that column.
- *
- * You can specify the key type of the array by additionally passing one
- * of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME,
- * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM.
- * The default key type is the column's BasePeer::TYPE_PHPNAME
- *
- * @param array $arr An array to populate the object from.
- * @param string $keyType The type of keys the array uses.
- * @return void
- */
- public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
- {
- $keys = CcPermsPeer::getFieldNames($keyType);
-
- if (array_key_exists($keys[0], $arr)) $this->setPermid($arr[$keys[0]]);
- if (array_key_exists($keys[1], $arr)) $this->setSubj($arr[$keys[1]]);
- if (array_key_exists($keys[2], $arr)) $this->setAction($arr[$keys[2]]);
- if (array_key_exists($keys[3], $arr)) $this->setObj($arr[$keys[3]]);
- if (array_key_exists($keys[4], $arr)) $this->setType($arr[$keys[4]]);
- }
-
- /**
- * Build a Criteria object containing the values of all modified columns in this object.
- *
- * @return Criteria The Criteria object containing all modified values.
- */
- public function buildCriteria()
- {
- $criteria = new Criteria(CcPermsPeer::DATABASE_NAME);
-
- if ($this->isColumnModified(CcPermsPeer::PERMID)) $criteria->add(CcPermsPeer::PERMID, $this->permid);
- if ($this->isColumnModified(CcPermsPeer::SUBJ)) $criteria->add(CcPermsPeer::SUBJ, $this->subj);
- if ($this->isColumnModified(CcPermsPeer::ACTION)) $criteria->add(CcPermsPeer::ACTION, $this->action);
- if ($this->isColumnModified(CcPermsPeer::OBJ)) $criteria->add(CcPermsPeer::OBJ, $this->obj);
- if ($this->isColumnModified(CcPermsPeer::TYPE)) $criteria->add(CcPermsPeer::TYPE, $this->type);
-
- return $criteria;
- }
-
- /**
- * Builds a Criteria object containing the primary key for this object.
- *
- * Unlike buildCriteria() this method includes the primary key values regardless
- * of whether or not they have been modified.
- *
- * @return Criteria The Criteria object containing value(s) for primary key(s).
- */
- public function buildPkeyCriteria()
- {
- $criteria = new Criteria(CcPermsPeer::DATABASE_NAME);
- $criteria->add(CcPermsPeer::PERMID, $this->permid);
-
- return $criteria;
- }
-
- /**
- * Returns the primary key for this object (row).
- * @return int
- */
- public function getPrimaryKey()
- {
- return $this->getPermid();
- }
-
- /**
- * Generic method to set the primary key (permid column).
- *
- * @param int $key Primary key.
- * @return void
- */
- public function setPrimaryKey($key)
- {
- $this->setPermid($key);
- }
-
- /**
- * Returns true if the primary key for this object is null.
- * @return boolean
- */
- public function isPrimaryKeyNull()
- {
-
- return null === $this->getPermid();
- }
-
- /**
- * Sets contents of passed object to values from current object.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param object $copyObj An object of CcPerms (or compatible) type.
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @param boolean $makeNew Whether to reset autoincrement PKs and make the object new.
- * @throws PropelException
- */
- public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
- {
- $copyObj->setSubj($this->getSubj());
- $copyObj->setAction($this->getAction());
- $copyObj->setObj($this->getObj());
- $copyObj->setType($this->getType());
-
- if ($deepCopy && !$this->startCopy) {
- // important: temporarily setNew(false) because this affects the behavior of
- // the getter/setter methods for fkey referrer objects.
- $copyObj->setNew(false);
- // store object hash to prevent cycle
- $this->startCopy = true;
-
- //unflag object copy
- $this->startCopy = false;
- } // if ($deepCopy)
-
- if ($makeNew) {
- $copyObj->setNew(true);
- $copyObj->setPermid(NULL); // this is a auto-increment column, so set to default value
- }
- }
-
- /**
- * Makes a copy of this object that will be inserted as a new row in table when saved.
- * It creates a new object filling in the simple attributes, but skipping any primary
- * keys that are defined for the table.
- *
- * If desired, this method can also make copies of all associated (fkey referrers)
- * objects.
- *
- * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
- * @return CcPerms Clone of current object.
- * @throws PropelException
- */
- public function copy($deepCopy = false)
- {
- // we use get_class(), because this might be a subclass
- $clazz = get_class($this);
- $copyObj = new $clazz();
- $this->copyInto($copyObj, $deepCopy);
-
- return $copyObj;
- }
-
- /**
- * Returns a peer instance associated with this om.
- *
- * Since Peer classes are not to have any instance attributes, this method returns the
- * same instance for all member of this class. The method could therefore
- * be static, but this would prevent one from overriding the behavior.
- *
- * @return CcPermsPeer
- */
- public function getPeer()
- {
- if (self::$peer === null) {
- self::$peer = new CcPermsPeer();
- }
-
- return self::$peer;
- }
-
- /**
- * Declares an association between this object and a CcSubjs object.
- *
- * @param CcSubjs $v
- * @return CcPerms The current object (for fluent API support)
- * @throws PropelException
- */
- public function setCcSubjs(CcSubjs $v = null)
- {
- if ($v === null) {
- $this->setSubj(NULL);
- } else {
- $this->setSubj($v->getDbId());
- }
-
- $this->aCcSubjs = $v;
-
- // Add binding for other direction of this n:n relationship.
- // If this object has already been added to the CcSubjs object, it will not be re-added.
- if ($v !== null) {
- $v->addCcPerms($this);
- }
-
-
- return $this;
- }
-
-
- /**
- * Get the associated CcSubjs object
- *
- * @param PropelPDO $con Optional Connection object.
- * @param $doQuery Executes a query to get the object if required
- * @return CcSubjs The associated CcSubjs object.
- * @throws PropelException
- */
- public function getCcSubjs(PropelPDO $con = null, $doQuery = true)
- {
- if ($this->aCcSubjs === null && ($this->subj !== null) && $doQuery) {
- $this->aCcSubjs = CcSubjsQuery::create()->findPk($this->subj, $con);
- /* The following can be used additionally to
- guarantee the related object contains a reference
- to this object. This level of coupling may, however, be
- undesirable since it could result in an only partially populated collection
- in the referenced object.
- $this->aCcSubjs->addCcPermss($this);
- */
- }
-
- return $this->aCcSubjs;
- }
-
- /**
- * Clears the current object and sets all attributes to their default values
- */
- public function clear()
- {
- $this->permid = null;
- $this->subj = null;
- $this->action = null;
- $this->obj = null;
- $this->type = null;
- $this->alreadyInSave = false;
- $this->alreadyInValidation = false;
- $this->alreadyInClearAllReferencesDeep = false;
- $this->clearAllReferences();
- $this->resetModified();
- $this->setNew(true);
- $this->setDeleted(false);
- }
-
- /**
- * Resets all references to other model objects or collections of model objects.
- *
- * This method is a user-space workaround for PHP's inability to garbage collect
- * objects with circular references (even in PHP 5.3). This is currently necessary
- * when using Propel in certain daemon or large-volume/high-memory operations.
- *
- * @param boolean $deep Whether to also clear the references on all referrer objects.
- */
- public function clearAllReferences($deep = false)
- {
- if ($deep && !$this->alreadyInClearAllReferencesDeep) {
- $this->alreadyInClearAllReferencesDeep = true;
- if ($this->aCcSubjs instanceof Persistent) {
- $this->aCcSubjs->clearAllReferences($deep);
- }
-
- $this->alreadyInClearAllReferencesDeep = false;
- } // if ($deep)
-
- $this->aCcSubjs = null;
- }
-
- /**
- * return the string representation of this object
- *
- * @return string
- */
- public function __toString()
- {
- return (string) $this->exportTo(CcPermsPeer::DEFAULT_STRING_FORMAT);
- }
-
- /**
- * return true is the object is in saving state
- *
- * @return boolean
- */
- public function isAlreadyInSave()
- {
- return $this->alreadyInSave;
- }
-
-}
diff --git a/legacy/application/models/airtime/om/BaseCcPermsPeer.php b/legacy/application/models/airtime/om/BaseCcPermsPeer.php
deleted file mode 100644
index 3907d15bb..000000000
--- a/legacy/application/models/airtime/om/BaseCcPermsPeer.php
+++ /dev/null
@@ -1,1009 +0,0 @@
- array ('Permid', 'Subj', 'Action', 'Obj', 'Type', ),
- BasePeer::TYPE_STUDLYPHPNAME => array ('permid', 'subj', 'action', 'obj', 'type', ),
- BasePeer::TYPE_COLNAME => array (CcPermsPeer::PERMID, CcPermsPeer::SUBJ, CcPermsPeer::ACTION, CcPermsPeer::OBJ, CcPermsPeer::TYPE, ),
- BasePeer::TYPE_RAW_COLNAME => array ('PERMID', 'SUBJ', 'ACTION', 'OBJ', 'TYPE', ),
- BasePeer::TYPE_FIELDNAME => array ('permid', 'subj', 'action', 'obj', 'type', ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
- );
-
- /**
- * holds an array of keys for quick access to the fieldnames array
- *
- * first dimension keys are the type constants
- * e.g. CcPermsPeer::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
- */
- protected static $fieldKeys = array (
- BasePeer::TYPE_PHPNAME => array ('Permid' => 0, 'Subj' => 1, 'Action' => 2, 'Obj' => 3, 'Type' => 4, ),
- BasePeer::TYPE_STUDLYPHPNAME => array ('permid' => 0, 'subj' => 1, 'action' => 2, 'obj' => 3, 'type' => 4, ),
- BasePeer::TYPE_COLNAME => array (CcPermsPeer::PERMID => 0, CcPermsPeer::SUBJ => 1, CcPermsPeer::ACTION => 2, CcPermsPeer::OBJ => 3, CcPermsPeer::TYPE => 4, ),
- BasePeer::TYPE_RAW_COLNAME => array ('PERMID' => 0, 'SUBJ' => 1, 'ACTION' => 2, 'OBJ' => 3, 'TYPE' => 4, ),
- BasePeer::TYPE_FIELDNAME => array ('permid' => 0, 'subj' => 1, 'action' => 2, 'obj' => 3, 'type' => 4, ),
- BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, )
- );
-
- /**
- * Translates a fieldname to another type
- *
- * @param string $name field name
- * @param string $fromType One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
- * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
- * @param string $toType One of the class type constants
- * @return string translated name of the field.
- * @throws PropelException - if the specified name could not be found in the fieldname mappings.
- */
- public static function translateFieldName($name, $fromType, $toType)
- {
- $toNames = CcPermsPeer::getFieldNames($toType);
- $key = isset(CcPermsPeer::$fieldKeys[$fromType][$name]) ? CcPermsPeer::$fieldKeys[$fromType][$name] : null;
- if ($key === null) {
- throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(CcPermsPeer::$fieldKeys[$fromType], true));
- }
-
- return $toNames[$key];
- }
-
- /**
- * Returns an array of field names.
- *
- * @param string $type The type of fieldnames to return:
- * One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
- * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
- * @return array A list of field names
- * @throws PropelException - if the type is not valid.
- */
- public static function getFieldNames($type = BasePeer::TYPE_PHPNAME)
- {
- if (!array_key_exists($type, CcPermsPeer::$fieldNames)) {
- throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. ' . $type . ' was given.');
- }
-
- return CcPermsPeer::$fieldNames[$type];
- }
-
- /**
- * Convenience method which changes table.column to alias.column.
- *
- * Using this method you can maintain SQL abstraction while using column aliases.
- *
- * $c->addAlias("alias1", TablePeer::TABLE_NAME);
- * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
- *
- * @param string $alias The alias for the current table.
- * @param string $column The column name for current table. (i.e. CcPermsPeer::COLUMN_NAME).
- * @return string
- */
- public static function alias($alias, $column)
- {
- return str_replace(CcPermsPeer::TABLE_NAME.'.', $alias.'.', $column);
- }
-
- /**
- * Add all the columns needed to create a new object.
- *
- * Note: any columns that were marked with lazyLoad="true" in the
- * XML schema will not be added to the select list and only loaded
- * on demand.
- *
- * @param Criteria $criteria object containing the columns to add.
- * @param string $alias optional table alias
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function addSelectColumns(Criteria $criteria, $alias = null)
- {
- if (null === $alias) {
- $criteria->addSelectColumn(CcPermsPeer::PERMID);
- $criteria->addSelectColumn(CcPermsPeer::SUBJ);
- $criteria->addSelectColumn(CcPermsPeer::ACTION);
- $criteria->addSelectColumn(CcPermsPeer::OBJ);
- $criteria->addSelectColumn(CcPermsPeer::TYPE);
- } else {
- $criteria->addSelectColumn($alias . '.permid');
- $criteria->addSelectColumn($alias . '.subj');
- $criteria->addSelectColumn($alias . '.action');
- $criteria->addSelectColumn($alias . '.obj');
- $criteria->addSelectColumn($alias . '.type');
- }
- }
-
- /**
- * Returns the number of rows matching criteria.
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
- * @param PropelPDO $con
- * @return int Number of matching rows.
- */
- public static function doCount(Criteria $criteria, $distinct = false, PropelPDO $con = null)
- {
- // we may modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // We need to set the primary table name, since in the case that there are no WHERE columns
- // it will be impossible for the BasePeer::createSelectSql() method to determine which
- // tables go into the FROM clause.
- $criteria->setPrimaryTableName(CcPermsPeer::TABLE_NAME);
-
- if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->setDistinct();
- }
-
- if (!$criteria->hasSelectClause()) {
- CcPermsPeer::addSelectColumns($criteria);
- }
-
- $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count
- $criteria->setDbName(CcPermsPeer::DATABASE_NAME); // Set the correct dbName
-
- if ($con === null) {
- $con = Propel::getConnection(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_READ);
- }
- // BasePeer returns a PDOStatement
- $stmt = BasePeer::doCount($criteria, $con);
-
- if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
- $count = (int) $row[0];
- } else {
- $count = 0; // no rows returned; we infer that means 0 matches.
- }
- $stmt->closeCursor();
-
- return $count;
- }
- /**
- * Selects one object from the DB.
- *
- * @param Criteria $criteria object used to create the SELECT statement.
- * @param PropelPDO $con
- * @return CcPerms
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectOne(Criteria $criteria, PropelPDO $con = null)
- {
- $critcopy = clone $criteria;
- $critcopy->setLimit(1);
- $objects = CcPermsPeer::doSelect($critcopy, $con);
- if ($objects) {
- return $objects[0];
- }
-
- return null;
- }
- /**
- * Selects several row from the DB.
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param PropelPDO $con
- * @return array Array of selected Objects
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelect(Criteria $criteria, PropelPDO $con = null)
- {
- return CcPermsPeer::populateObjects(CcPermsPeer::doSelectStmt($criteria, $con));
- }
- /**
- * Prepares the Criteria object and uses the parent doSelect() method to execute a PDOStatement.
- *
- * Use this method directly if you want to work with an executed statement directly (for example
- * to perform your own object hydration).
- *
- * @param Criteria $criteria The Criteria object used to build the SELECT statement.
- * @param PropelPDO $con The connection to use
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return PDOStatement The executed PDOStatement object.
- * @see BasePeer::doSelect()
- */
- public static function doSelectStmt(Criteria $criteria, PropelPDO $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_READ);
- }
-
- if (!$criteria->hasSelectClause()) {
- $criteria = clone $criteria;
- CcPermsPeer::addSelectColumns($criteria);
- }
-
- // Set the correct dbName
- $criteria->setDbName(CcPermsPeer::DATABASE_NAME);
-
- // BasePeer returns a PDOStatement
- return BasePeer::doSelect($criteria, $con);
- }
- /**
- * Adds an object to the instance pool.
- *
- * Propel keeps cached copies of objects in an instance pool when they are retrieved
- * from the database. In some cases -- especially when you override doSelect*()
- * methods in your stub classes -- you may need to explicitly add objects
- * to the cache in order to ensure that the same objects are always returned by doSelect*()
- * and retrieveByPK*() calls.
- *
- * @param CcPerms $obj A CcPerms object.
- * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
- */
- public static function addInstanceToPool($obj, $key = null)
- {
- if (Propel::isInstancePoolingEnabled()) {
- if ($key === null) {
- $key = (string) $obj->getPermid();
- } // if key === null
- CcPermsPeer::$instances[$key] = $obj;
- }
- }
-
- /**
- * Removes an object from the instance pool.
- *
- * Propel keeps cached copies of objects in an instance pool when they are retrieved
- * from the database. In some cases -- especially when you override doDelete
- * methods in your stub classes -- you may need to explicitly remove objects
- * from the cache in order to prevent returning objects that no longer exist.
- *
- * @param mixed $value A CcPerms object or a primary key value.
- *
- * @return void
- * @throws PropelException - if the value is invalid.
- */
- public static function removeInstanceFromPool($value)
- {
- if (Propel::isInstancePoolingEnabled() && $value !== null) {
- if (is_object($value) && $value instanceof CcPerms) {
- $key = (string) $value->getPermid();
- } elseif (is_scalar($value)) {
- // assume we've been passed a primary key
- $key = (string) $value;
- } else {
- $e = new PropelException("Invalid value passed to removeInstanceFromPool(). Expected primary key or CcPerms object; got " . (is_object($value) ? get_class($value) . ' object.' : var_export($value,true)));
- throw $e;
- }
-
- unset(CcPermsPeer::$instances[$key]);
- }
- } // removeInstanceFromPool()
-
- /**
- * Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
- *
- * For tables with a single-column primary key, that simple pkey value will be returned. For tables with
- * a multi-column primary key, a serialize()d version of the primary key will be returned.
- *
- * @param string $key The key (@see getPrimaryKeyHash()) for this instance.
- * @return CcPerms Found object or null if 1) no instance exists for specified key or 2) instance pooling has been disabled.
- * @see getPrimaryKeyHash()
- */
- public static function getInstanceFromPool($key)
- {
- if (Propel::isInstancePoolingEnabled()) {
- if (isset(CcPermsPeer::$instances[$key])) {
- return CcPermsPeer::$instances[$key];
- }
- }
-
- return null; // just to be explicit
- }
-
- /**
- * Clear the instance pool.
- *
- * @return void
- */
- public static function clearInstancePool($and_clear_all_references = false)
- {
- if ($and_clear_all_references) {
- foreach (CcPermsPeer::$instances as $instance) {
- $instance->clearAllReferences(true);
- }
- }
- CcPermsPeer::$instances = array();
- }
-
- /**
- * Method to invalidate the instance pool of all tables related to cc_perms
- * by a foreign key with ON DELETE CASCADE
- */
- public static function clearRelatedInstancePool()
- {
- }
-
- /**
- * Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
- *
- * For tables with a single-column primary key, that simple pkey value will be returned. For tables with
- * a multi-column primary key, a serialize()d version of the primary key will be returned.
- *
- * @param array $row PropelPDO resultset row.
- * @param int $startcol The 0-based offset for reading from the resultset row.
- * @return string A string version of PK or null if the components of primary key in result array are all null.
- */
- public static function getPrimaryKeyHashFromRow($row, $startcol = 0)
- {
- // If the PK cannot be derived from the row, return null.
- if ($row[$startcol] === null) {
- return null;
- }
-
- return (string) $row[$startcol];
- }
-
- /**
- * Retrieves the primary key from the DB resultset row
- * For tables with a single-column primary key, that simple pkey value will be returned. For tables with
- * a multi-column primary key, an array of the primary key columns will be returned.
- *
- * @param array $row PropelPDO resultset row.
- * @param int $startcol The 0-based offset for reading from the resultset row.
- * @return mixed The primary key of the row
- */
- public static function getPrimaryKeyFromRow($row, $startcol = 0)
- {
-
- return (int) $row[$startcol];
- }
-
- /**
- * The returned array will contain objects of the default type or
- * objects that inherit from the default.
- *
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function populateObjects(PDOStatement $stmt)
- {
- $results = array();
-
- // set the class once to avoid overhead in the loop
- $cls = CcPermsPeer::getOMClass();
- // populate the object(s)
- while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
- $key = CcPermsPeer::getPrimaryKeyHashFromRow($row, 0);
- if (null !== ($obj = CcPermsPeer::getInstanceFromPool($key))) {
- // We no longer rehydrate the object, since this can cause data loss.
- // See http://www.propelorm.org/ticket/509
- // $obj->hydrate($row, 0, true); // rehydrate
- $results[] = $obj;
- } else {
- $obj = new $cls();
- $obj->hydrate($row);
- $results[] = $obj;
- CcPermsPeer::addInstanceToPool($obj, $key);
- } // if key exists
- }
- $stmt->closeCursor();
-
- return $results;
- }
- /**
- * Populates an object of the default type or an object that inherit from the default.
- *
- * @param array $row PropelPDO resultset row.
- * @param int $startcol The 0-based offset for reading from the resultset row.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- * @return array (CcPerms object, last column rank)
- */
- public static function populateObject($row, $startcol = 0)
- {
- $key = CcPermsPeer::getPrimaryKeyHashFromRow($row, $startcol);
- if (null !== ($obj = CcPermsPeer::getInstanceFromPool($key))) {
- // We no longer rehydrate the object, since this can cause data loss.
- // See http://www.propelorm.org/ticket/509
- // $obj->hydrate($row, $startcol, true); // rehydrate
- $col = $startcol + CcPermsPeer::NUM_HYDRATE_COLUMNS;
- } else {
- $cls = CcPermsPeer::OM_CLASS;
- $obj = new $cls();
- $col = $obj->hydrate($row, $startcol);
- CcPermsPeer::addInstanceToPool($obj, $key);
- }
-
- return array($obj, $col);
- }
-
-
- /**
- * Returns the number of rows matching criteria, joining the related CcSubjs table
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
- * @param PropelPDO $con
- * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
- * @return int Number of matching rows.
- */
- public static function doCountJoinCcSubjs(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // We need to set the primary table name, since in the case that there are no WHERE columns
- // it will be impossible for the BasePeer::createSelectSql() method to determine which
- // tables go into the FROM clause.
- $criteria->setPrimaryTableName(CcPermsPeer::TABLE_NAME);
-
- if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->setDistinct();
- }
-
- if (!$criteria->hasSelectClause()) {
- CcPermsPeer::addSelectColumns($criteria);
- }
-
- $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count
-
- // Set the correct dbName
- $criteria->setDbName(CcPermsPeer::DATABASE_NAME);
-
- if ($con === null) {
- $con = Propel::getConnection(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_READ);
- }
-
- $criteria->addJoin(CcPermsPeer::SUBJ, CcSubjsPeer::ID, $join_behavior);
-
- $stmt = BasePeer::doCount($criteria, $con);
-
- if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
- $count = (int) $row[0];
- } else {
- $count = 0; // no rows returned; we infer that means 0 matches.
- }
- $stmt->closeCursor();
-
- return $count;
- }
-
-
- /**
- * Selects a collection of CcPerms objects pre-filled with their CcSubjs objects.
- * @param Criteria $criteria
- * @param PropelPDO $con
- * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
- * @return array Array of CcPerms objects.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectJoinCcSubjs(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
- {
- $criteria = clone $criteria;
-
- // Set the correct dbName if it has not been overridden
- if ($criteria->getDbName() == Propel::getDefaultDB()) {
- $criteria->setDbName(CcPermsPeer::DATABASE_NAME);
- }
-
- CcPermsPeer::addSelectColumns($criteria);
- $startcol = CcPermsPeer::NUM_HYDRATE_COLUMNS;
- CcSubjsPeer::addSelectColumns($criteria);
-
- $criteria->addJoin(CcPermsPeer::SUBJ, CcSubjsPeer::ID, $join_behavior);
-
- $stmt = BasePeer::doSelect($criteria, $con);
- $results = array();
-
- while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
- $key1 = CcPermsPeer::getPrimaryKeyHashFromRow($row, 0);
- if (null !== ($obj1 = CcPermsPeer::getInstanceFromPool($key1))) {
- // We no longer rehydrate the object, since this can cause data loss.
- // See http://www.propelorm.org/ticket/509
- // $obj1->hydrate($row, 0, true); // rehydrate
- } else {
-
- $cls = CcPermsPeer::getOMClass();
-
- $obj1 = new $cls();
- $obj1->hydrate($row);
- CcPermsPeer::addInstanceToPool($obj1, $key1);
- } // if $obj1 already loaded
-
- $key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol);
- if ($key2 !== null) {
- $obj2 = CcSubjsPeer::getInstanceFromPool($key2);
- if (!$obj2) {
-
- $cls = CcSubjsPeer::getOMClass();
-
- $obj2 = new $cls();
- $obj2->hydrate($row, $startcol);
- CcSubjsPeer::addInstanceToPool($obj2, $key2);
- } // if obj2 already loaded
-
- // Add the $obj1 (CcPerms) to $obj2 (CcSubjs)
- $obj2->addCcPerms($obj1);
-
- } // if joined row was not null
-
- $results[] = $obj1;
- }
- $stmt->closeCursor();
-
- return $results;
- }
-
-
- /**
- * Returns the number of rows matching criteria, joining all related tables
- *
- * @param Criteria $criteria
- * @param boolean $distinct Whether to select only distinct columns; deprecated: use Criteria->setDistinct() instead.
- * @param PropelPDO $con
- * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
- * @return int Number of matching rows.
- */
- public static function doCountJoinAll(Criteria $criteria, $distinct = false, PropelPDO $con = null, $join_behavior = Criteria::LEFT_JOIN)
- {
- // we're going to modify criteria, so copy it first
- $criteria = clone $criteria;
-
- // We need to set the primary table name, since in the case that there are no WHERE columns
- // it will be impossible for the BasePeer::createSelectSql() method to determine which
- // tables go into the FROM clause.
- $criteria->setPrimaryTableName(CcPermsPeer::TABLE_NAME);
-
- if ($distinct && !in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
- $criteria->setDistinct();
- }
-
- if (!$criteria->hasSelectClause()) {
- CcPermsPeer::addSelectColumns($criteria);
- }
-
- $criteria->clearOrderByColumns(); // ORDER BY won't ever affect the count
-
- // Set the correct dbName
- $criteria->setDbName(CcPermsPeer::DATABASE_NAME);
-
- if ($con === null) {
- $con = Propel::getConnection(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_READ);
- }
-
- $criteria->addJoin(CcPermsPeer::SUBJ, CcSubjsPeer::ID, $join_behavior);
-
- $stmt = BasePeer::doCount($criteria, $con);
-
- if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
- $count = (int) $row[0];
- } else {
- $count = 0; // no rows returned; we infer that means 0 matches.
- }
- $stmt->closeCursor();
-
- return $count;
- }
-
- /**
- * Selects a collection of CcPerms objects pre-filled with all related objects.
- *
- * @param Criteria $criteria
- * @param PropelPDO $con
- * @param String $join_behavior the type of joins to use, defaults to Criteria::LEFT_JOIN
- * @return array Array of CcPerms objects.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doSelectJoinAll(Criteria $criteria, $con = null, $join_behavior = Criteria::LEFT_JOIN)
- {
- $criteria = clone $criteria;
-
- // Set the correct dbName if it has not been overridden
- if ($criteria->getDbName() == Propel::getDefaultDB()) {
- $criteria->setDbName(CcPermsPeer::DATABASE_NAME);
- }
-
- CcPermsPeer::addSelectColumns($criteria);
- $startcol2 = CcPermsPeer::NUM_HYDRATE_COLUMNS;
-
- CcSubjsPeer::addSelectColumns($criteria);
- $startcol3 = $startcol2 + CcSubjsPeer::NUM_HYDRATE_COLUMNS;
-
- $criteria->addJoin(CcPermsPeer::SUBJ, CcSubjsPeer::ID, $join_behavior);
-
- $stmt = BasePeer::doSelect($criteria, $con);
- $results = array();
-
- while ($row = $stmt->fetch(PDO::FETCH_NUM)) {
- $key1 = CcPermsPeer::getPrimaryKeyHashFromRow($row, 0);
- if (null !== ($obj1 = CcPermsPeer::getInstanceFromPool($key1))) {
- // We no longer rehydrate the object, since this can cause data loss.
- // See http://www.propelorm.org/ticket/509
- // $obj1->hydrate($row, 0, true); // rehydrate
- } else {
- $cls = CcPermsPeer::getOMClass();
-
- $obj1 = new $cls();
- $obj1->hydrate($row);
- CcPermsPeer::addInstanceToPool($obj1, $key1);
- } // if obj1 already loaded
-
- // Add objects for joined CcSubjs rows
-
- $key2 = CcSubjsPeer::getPrimaryKeyHashFromRow($row, $startcol2);
- if ($key2 !== null) {
- $obj2 = CcSubjsPeer::getInstanceFromPool($key2);
- if (!$obj2) {
-
- $cls = CcSubjsPeer::getOMClass();
-
- $obj2 = new $cls();
- $obj2->hydrate($row, $startcol2);
- CcSubjsPeer::addInstanceToPool($obj2, $key2);
- } // if obj2 loaded
-
- // Add the $obj1 (CcPerms) to the collection in $obj2 (CcSubjs)
- $obj2->addCcPerms($obj1);
- } // if joined row not null
-
- $results[] = $obj1;
- }
- $stmt->closeCursor();
-
- return $results;
- }
-
- /**
- * Returns the TableMap related to this peer.
- * This method is not needed for general use but a specific application could have a need.
- * @return TableMap
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function getTableMap()
- {
- return Propel::getDatabaseMap(CcPermsPeer::DATABASE_NAME)->getTable(CcPermsPeer::TABLE_NAME);
- }
-
- /**
- * Add a TableMap instance to the database for this peer class.
- */
- public static function buildTableMap()
- {
- $dbMap = Propel::getDatabaseMap(BaseCcPermsPeer::DATABASE_NAME);
- if (!$dbMap->hasTable(BaseCcPermsPeer::TABLE_NAME)) {
- $dbMap->addTableObject(new \CcPermsTableMap());
- }
- }
-
- /**
- * The class that the Peer will make instances of.
- *
- *
- * @return string ClassName
- */
- public static function getOMClass($row = 0, $colnum = 0)
- {
- return CcPermsPeer::OM_CLASS;
- }
-
- /**
- * Performs an INSERT on the database, given a CcPerms or Criteria object.
- *
- * @param mixed $values Criteria or CcPerms object containing data that is used to create the INSERT statement.
- * @param PropelPDO $con the PropelPDO connection to use
- * @return mixed The new primary key.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doInsert($values, PropelPDO $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
- }
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
- } else {
- $criteria = $values->buildCriteria(); // build Criteria from CcPerms object
- }
-
-
- // Set the correct dbName
- $criteria->setDbName(CcPermsPeer::DATABASE_NAME);
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table (I guess, conceivably)
- $con->beginTransaction();
- $pk = BasePeer::doInsert($criteria, $con);
- $con->commit();
- } catch (Exception $e) {
- $con->rollBack();
- throw $e;
- }
-
- return $pk;
- }
-
- /**
- * Performs an UPDATE on the database, given a CcPerms or Criteria object.
- *
- * @param mixed $values Criteria or CcPerms object containing data that is used to create the UPDATE statement.
- * @param PropelPDO $con The connection to use (specify PropelPDO connection object to exert more control over transactions).
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doUpdate($values, PropelPDO $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
- }
-
- $selectCriteria = new Criteria(CcPermsPeer::DATABASE_NAME);
-
- if ($values instanceof Criteria) {
- $criteria = clone $values; // rename for clarity
-
- $comparison = $criteria->getComparison(CcPermsPeer::PERMID);
- $value = $criteria->remove(CcPermsPeer::PERMID);
- if ($value) {
- $selectCriteria->add(CcPermsPeer::PERMID, $value, $comparison);
- } else {
- $selectCriteria->setPrimaryTableName(CcPermsPeer::TABLE_NAME);
- }
-
- } else { // $values is CcPerms object
- $criteria = $values->buildCriteria(); // gets full criteria
- $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
- }
-
- // set the correct dbName
- $criteria->setDbName(CcPermsPeer::DATABASE_NAME);
-
- return BasePeer::doUpdate($selectCriteria, $criteria, $con);
- }
-
- /**
- * Deletes all rows from the cc_perms table.
- *
- * @param PropelPDO $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver).
- * @throws PropelException
- */
- public static function doDeleteAll(PropelPDO $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
- }
- $affectedRows = 0; // initialize var to track total num of affected rows
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->beginTransaction();
- $affectedRows += BasePeer::doDeleteAll(CcPermsPeer::TABLE_NAME, $con, CcPermsPeer::DATABASE_NAME);
- // Because this db requires some delete cascade/set null emulation, we have to
- // clear the cached instance *after* the emulation has happened (since
- // instances get re-added by the select statement contained therein).
- CcPermsPeer::clearInstancePool();
- CcPermsPeer::clearRelatedInstancePool();
- $con->commit();
-
- return $affectedRows;
- } catch (Exception $e) {
- $con->rollBack();
- throw $e;
- }
- }
-
- /**
- * Performs a DELETE on the database, given a CcPerms or Criteria object OR a primary key value.
- *
- * @param mixed $values Criteria or CcPerms object or primary key or array of primary keys
- * which is used to create the DELETE statement
- * @param PropelPDO $con the connection to use
- * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
- * if supported by native driver or if emulated using Propel.
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function doDelete($values, PropelPDO $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
- }
-
- if ($values instanceof Criteria) {
- // invalidate the cache for all objects of this type, since we have no
- // way of knowing (without running a query) what objects should be invalidated
- // from the cache based on this Criteria.
- CcPermsPeer::clearInstancePool();
- // rename for clarity
- $criteria = clone $values;
- } elseif ($values instanceof CcPerms) { // it's a model object
- // invalidate the cache for this single object
- CcPermsPeer::removeInstanceFromPool($values);
- // create criteria based on pk values
- $criteria = $values->buildPkeyCriteria();
- } else { // it's a primary key, or an array of pks
- $criteria = new Criteria(CcPermsPeer::DATABASE_NAME);
- $criteria->add(CcPermsPeer::PERMID, (array) $values, Criteria::IN);
- // invalidate the cache for this object(s)
- foreach ((array) $values as $singleval) {
- CcPermsPeer::removeInstanceFromPool($singleval);
- }
- }
-
- // Set the correct dbName
- $criteria->setDbName(CcPermsPeer::DATABASE_NAME);
-
- $affectedRows = 0; // initialize var to track total num of affected rows
-
- try {
- // use transaction because $criteria could contain info
- // for more than one table or we could emulating ON DELETE CASCADE, etc.
- $con->beginTransaction();
-
- $affectedRows += BasePeer::doDelete($criteria, $con);
- CcPermsPeer::clearRelatedInstancePool();
- $con->commit();
-
- return $affectedRows;
- } catch (Exception $e) {
- $con->rollBack();
- throw $e;
- }
- }
-
- /**
- * Validates all modified columns of given CcPerms object.
- * If parameter $columns is either a single column name or an array of column names
- * than only those columns are validated.
- *
- * NOTICE: This does not apply to primary or foreign keys for now.
- *
- * @param CcPerms $obj The object to validate.
- * @param mixed $cols Column name or array of column names.
- *
- * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
- */
- public static function doValidate($obj, $cols = null)
- {
- $columns = array();
-
- if ($cols) {
- $dbMap = Propel::getDatabaseMap(CcPermsPeer::DATABASE_NAME);
- $tableMap = $dbMap->getTable(CcPermsPeer::TABLE_NAME);
-
- if (! is_array($cols)) {
- $cols = array($cols);
- }
-
- foreach ($cols as $colName) {
- if ($tableMap->hasColumn($colName)) {
- $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
- $columns[$colName] = $obj->$get();
- }
- }
- } else {
-
- }
-
- return BasePeer::doValidate(CcPermsPeer::DATABASE_NAME, CcPermsPeer::TABLE_NAME, $columns);
- }
-
- /**
- * Retrieve a single object by pkey.
- *
- * @param int $pk the primary key.
- * @param PropelPDO $con the connection to use
- * @return CcPerms
- */
- public static function retrieveByPK($pk, PropelPDO $con = null)
- {
-
- if (null !== ($obj = CcPermsPeer::getInstanceFromPool((string) $pk))) {
- return $obj;
- }
-
- if ($con === null) {
- $con = Propel::getConnection(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_READ);
- }
-
- $criteria = new Criteria(CcPermsPeer::DATABASE_NAME);
- $criteria->add(CcPermsPeer::PERMID, $pk);
-
- $v = CcPermsPeer::doSelect($criteria, $con);
-
- return !empty($v) > 0 ? $v[0] : null;
- }
-
- /**
- * Retrieve multiple objects by pkey.
- *
- * @param array $pks List of primary keys
- * @param PropelPDO $con the connection to use
- * @return CcPerms[]
- * @throws PropelException Any exceptions caught during processing will be
- * rethrown wrapped into a PropelException.
- */
- public static function retrieveByPKs($pks, PropelPDO $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_READ);
- }
-
- $objs = null;
- if (empty($pks)) {
- $objs = array();
- } else {
- $criteria = new Criteria(CcPermsPeer::DATABASE_NAME);
- $criteria->add(CcPermsPeer::PERMID, $pks, Criteria::IN);
- $objs = CcPermsPeer::doSelect($criteria, $con);
- }
-
- return $objs;
- }
-
-} // BaseCcPermsPeer
-
-// This is the static code needed to register the TableMap for this table with the main Propel class.
-//
-BaseCcPermsPeer::buildTableMap();
diff --git a/legacy/application/models/airtime/om/BaseCcPermsQuery.php b/legacy/application/models/airtime/om/BaseCcPermsQuery.php
deleted file mode 100644
index f01a73a22..000000000
--- a/legacy/application/models/airtime/om/BaseCcPermsQuery.php
+++ /dev/null
@@ -1,516 +0,0 @@
-mergeWith($criteria);
- }
-
- return $query;
- }
-
- /**
- * Find object by primary key.
- * Propel uses the instance pool to skip the database if the object exists.
- * Go fast if the query is untouched.
- *
- *
- * $obj = $c->findPk(12, $con);
- *
- *
- * @param mixed $key Primary key to use for the query
- * @param PropelPDO $con an optional connection object
- *
- * @return CcPerms|CcPerms[]|mixed the result, formatted by the current formatter
- */
- public function findPk($key, $con = null)
- {
- if ($key === null) {
- return null;
- }
- if ((null !== ($obj = CcPermsPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {
- // the object is already in the instance pool
- return $obj;
- }
- if ($con === null) {
- $con = Propel::getConnection(CcPermsPeer::DATABASE_NAME, Propel::CONNECTION_READ);
- }
- $this->basePreSelect($con);
- if ($this->formatter || $this->modelAlias || $this->with || $this->select
- || $this->selectColumns || $this->asColumns || $this->selectModifiers
- || $this->map || $this->having || $this->joins) {
- return $this->findPkComplex($key, $con);
- } else {
- return $this->findPkSimple($key, $con);
- }
- }
-
- /**
- * Alias of findPk to use instance pooling
- *
- * @param mixed $key Primary key to use for the query
- * @param PropelPDO $con A connection object
- *
- * @return CcPerms A model object, or null if the key is not found
- * @throws PropelException
- */
- public function findOneByPermid($key, $con = null)
- {
- return $this->findPk($key, $con);
- }
-
- /**
- * Find object by primary key using raw SQL to go fast.
- * Bypass doSelect() and the object formatter by using generated code.
- *
- * @param mixed $key Primary key to use for the query
- * @param PropelPDO $con A connection object
- *
- * @return CcPerms A model object, or null if the key is not found
- * @throws PropelException
- */
- protected function findPkSimple($key, $con)
- {
- $sql = 'SELECT "permid", "subj", "action", "obj", "type" FROM "cc_perms" WHERE "permid" = :p0';
- try {
- $stmt = $con->prepare($sql);
- $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
- $stmt->execute();
- } catch (Exception $e) {
- Propel::log($e->getMessage(), Propel::LOG_ERR);
- throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);
- }
- $obj = null;
- if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
- $obj = new CcPerms();
- $obj->hydrate($row);
- CcPermsPeer::addInstanceToPool($obj, (string) $key);
- }
- $stmt->closeCursor();
-
- return $obj;
- }
-
- /**
- * Find object by primary key.
- *
- * @param mixed $key Primary key to use for the query
- * @param PropelPDO $con A connection object
- *
- * @return CcPerms|CcPerms[]|mixed the result, formatted by the current formatter
- */
- protected function findPkComplex($key, $con)
- {
- // As the query uses a PK condition, no limit(1) is necessary.
- $criteria = $this->isKeepQuery() ? clone $this : $this;
- $stmt = $criteria
- ->filterByPrimaryKey($key)
- ->doSelect($con);
-
- return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
- }
-
- /**
- * Find objects by primary key
- *
- * $objs = $c->findPks(array(12, 56, 832), $con);
- *
- * @param array $keys Primary keys to use for the query
- * @param PropelPDO $con an optional connection object
- *
- * @return PropelObjectCollection|CcPerms[]|mixed the list of results, formatted by the current formatter
- */
- public function findPks($keys, $con = null)
- {
- if ($con === null) {
- $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
- }
- $this->basePreSelect($con);
- $criteria = $this->isKeepQuery() ? clone $this : $this;
- $stmt = $criteria
- ->filterByPrimaryKeys($keys)
- ->doSelect($con);
-
- return $criteria->getFormatter()->init($criteria)->format($stmt);
- }
-
- /**
- * Filter the query by primary key
- *
- * @param mixed $key Primary key to use for the query
- *
- * @return CcPermsQuery The current query, for fluid interface
- */
- public function filterByPrimaryKey($key)
- {
-
- return $this->addUsingAlias(CcPermsPeer::PERMID, $key, Criteria::EQUAL);
- }
-
- /**
- * Filter the query by a list of primary keys
- *
- * @param array $keys The list of primary key to use for the query
- *
- * @return CcPermsQuery The current query, for fluid interface
- */
- public function filterByPrimaryKeys($keys)
- {
-
- return $this->addUsingAlias(CcPermsPeer::PERMID, $keys, Criteria::IN);
- }
-
- /**
- * Filter the query on the permid column
- *
- * Example usage:
- *
- * $query->filterByPermid(1234); // WHERE permid = 1234
- * $query->filterByPermid(array(12, 34)); // WHERE permid IN (12, 34)
- * $query->filterByPermid(array('min' => 12)); // WHERE permid >= 12
- * $query->filterByPermid(array('max' => 12)); // WHERE permid <= 12
- *
- *
- * @param mixed $permid 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 CcPermsQuery The current query, for fluid interface
- */
- public function filterByPermid($permid = null, $comparison = null)
- {
- if (is_array($permid)) {
- $useMinMax = false;
- if (isset($permid['min'])) {
- $this->addUsingAlias(CcPermsPeer::PERMID, $permid['min'], Criteria::GREATER_EQUAL);
- $useMinMax = true;
- }
- if (isset($permid['max'])) {
- $this->addUsingAlias(CcPermsPeer::PERMID, $permid['max'], Criteria::LESS_EQUAL);
- $useMinMax = true;
- }
- if ($useMinMax) {
- return $this;
- }
- if (null === $comparison) {
- $comparison = Criteria::IN;
- }
- }
-
- return $this->addUsingAlias(CcPermsPeer::PERMID, $permid, $comparison);
- }
-
- /**
- * Filter the query on the subj column
- *
- * Example usage:
- *
- * $query->filterBySubj(1234); // WHERE subj = 1234
- * $query->filterBySubj(array(12, 34)); // WHERE subj IN (12, 34)
- * $query->filterBySubj(array('min' => 12)); // WHERE subj >= 12
- * $query->filterBySubj(array('max' => 12)); // WHERE subj <= 12
- *
- *
- * @see filterByCcSubjs()
- *
- * @param mixed $subj 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 CcPermsQuery The current query, for fluid interface
- */
- public function filterBySubj($subj = null, $comparison = null)
- {
- if (is_array($subj)) {
- $useMinMax = false;
- if (isset($subj['min'])) {
- $this->addUsingAlias(CcPermsPeer::SUBJ, $subj['min'], Criteria::GREATER_EQUAL);
- $useMinMax = true;
- }
- if (isset($subj['max'])) {
- $this->addUsingAlias(CcPermsPeer::SUBJ, $subj['max'], Criteria::LESS_EQUAL);
- $useMinMax = true;
- }
- if ($useMinMax) {
- return $this;
- }
- if (null === $comparison) {
- $comparison = Criteria::IN;
- }
- }
-
- return $this->addUsingAlias(CcPermsPeer::SUBJ, $subj, $comparison);
- }
-
- /**
- * Filter the query on the action column
- *
- * Example usage:
- *
- * $query->filterByAction('fooValue'); // WHERE action = 'fooValue'
- * $query->filterByAction('%fooValue%'); // WHERE action LIKE '%fooValue%'
- *
- *
- * @param string $action 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 CcPermsQuery The current query, for fluid interface
- */
- public function filterByAction($action = null, $comparison = null)
- {
- if (null === $comparison) {
- if (is_array($action)) {
- $comparison = Criteria::IN;
- } elseif (preg_match('/[\%\*]/', $action)) {
- $action = str_replace('*', '%', $action);
- $comparison = Criteria::LIKE;
- }
- }
-
- return $this->addUsingAlias(CcPermsPeer::ACTION, $action, $comparison);
- }
-
- /**
- * Filter the query on the obj column
- *
- * Example usage:
- *
- * $query->filterByObj(1234); // WHERE obj = 1234
- * $query->filterByObj(array(12, 34)); // WHERE obj IN (12, 34)
- * $query->filterByObj(array('min' => 12)); // WHERE obj >= 12
- * $query->filterByObj(array('max' => 12)); // WHERE obj <= 12
- *
- *
- * @param mixed $obj 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 CcPermsQuery The current query, for fluid interface
- */
- public function filterByObj($obj = null, $comparison = null)
- {
- if (is_array($obj)) {
- $useMinMax = false;
- if (isset($obj['min'])) {
- $this->addUsingAlias(CcPermsPeer::OBJ, $obj['min'], Criteria::GREATER_EQUAL);
- $useMinMax = true;
- }
- if (isset($obj['max'])) {
- $this->addUsingAlias(CcPermsPeer::OBJ, $obj['max'], Criteria::LESS_EQUAL);
- $useMinMax = true;
- }
- if ($useMinMax) {
- return $this;
- }
- if (null === $comparison) {
- $comparison = Criteria::IN;
- }
- }
-
- return $this->addUsingAlias(CcPermsPeer::OBJ, $obj, $comparison);
- }
-
- /**
- * Filter the query on the type column
- *
- * Example usage:
- *
- * $query->filterByType('fooValue'); // WHERE type = 'fooValue'
- * $query->filterByType('%fooValue%'); // WHERE type LIKE '%fooValue%'
- *
- *
- * @param string $type 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 CcPermsQuery The current query, for fluid interface
- */
- public function filterByType($type = null, $comparison = null)
- {
- if (null === $comparison) {
- if (is_array($type)) {
- $comparison = Criteria::IN;
- } elseif (preg_match('/[\%\*]/', $type)) {
- $type = str_replace('*', '%', $type);
- $comparison = Criteria::LIKE;
- }
- }
-
- return $this->addUsingAlias(CcPermsPeer::TYPE, $type, $comparison);
- }
-
- /**
- * Filter the query by a related CcSubjs object
- *
- * @param CcSubjs|PropelObjectCollection $ccSubjs The related object(s) to use as filter
- * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
- *
- * @return CcPermsQuery The current query, for fluid interface
- * @throws PropelException - if the provided filter is invalid.
- */
- public function filterByCcSubjs($ccSubjs, $comparison = null)
- {
- if ($ccSubjs instanceof CcSubjs) {
- return $this
- ->addUsingAlias(CcPermsPeer::SUBJ, $ccSubjs->getDbId(), $comparison);
- } elseif ($ccSubjs instanceof PropelObjectCollection) {
- if (null === $comparison) {
- $comparison = Criteria::IN;
- }
-
- return $this
- ->addUsingAlias(CcPermsPeer::SUBJ, $ccSubjs->toKeyValue('PrimaryKey', 'DbId'), $comparison);
- } else {
- throw new PropelException('filterByCcSubjs() only accepts arguments of type CcSubjs or PropelCollection');
- }
- }
-
- /**
- * Adds a JOIN clause to the query using the CcSubjs relation
- *
- * @param string $relationAlias optional alias for the relation
- * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
- *
- * @return CcPermsQuery The current query, for fluid interface
- */
- public function joinCcSubjs($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
- {
- $tableMap = $this->getTableMap();
- $relationMap = $tableMap->getRelation('CcSubjs');
-
- // create a ModelJoin object for this join
- $join = new ModelJoin();
- $join->setJoinType($joinType);
- $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
- if ($previousJoin = $this->getPreviousJoin()) {
- $join->setPreviousJoin($previousJoin);
- }
-
- // add the ModelJoin to the current object
- if ($relationAlias) {
- $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
- $this->addJoinObject($join, $relationAlias);
- } else {
- $this->addJoinObject($join, 'CcSubjs');
- }
-
- return $this;
- }
-
- /**
- * Use the CcSubjs relation CcSubjs object
- *
- * @see useQuery()
- *
- * @param string $relationAlias optional alias for the relation,
- * to be used as main alias in the secondary query
- * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
- *
- * @return CcSubjsQuery A secondary query class using the current class as primary query
- */
- public function useCcSubjsQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
- {
- return $this
- ->joinCcSubjs($relationAlias, $joinType)
- ->useQuery($relationAlias ? $relationAlias : 'CcSubjs', 'CcSubjsQuery');
- }
-
- /**
- * Exclude object from result
- *
- * @param CcPerms $ccPerms Object to remove from the list of results
- *
- * @return CcPermsQuery The current query, for fluid interface
- */
- public function prune($ccPerms = null)
- {
- if ($ccPerms) {
- $this->addUsingAlias(CcPermsPeer::PERMID, $ccPerms->getPermid(), Criteria::NOT_EQUAL);
- }
-
- return $this;
- }
-
-}
diff --git a/legacy/application/models/airtime/om/BaseCcSubjs.php b/legacy/application/models/airtime/om/BaseCcSubjs.php
index af05a2c5a..63153f3fc 100644
--- a/legacy/application/models/airtime/om/BaseCcSubjs.php
+++ b/legacy/application/models/airtime/om/BaseCcSubjs.php
@@ -125,12 +125,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
protected $collCcFilessRelatedByDbEditedby;
protected $collCcFilessRelatedByDbEditedbyPartial;
- /**
- * @var PropelObjectCollection|CcPerms[] Collection to store aggregation of CcPerms objects.
- */
- protected $collCcPermss;
- protected $collCcPermssPartial;
-
/**
* @var PropelObjectCollection|CcShowHosts[] Collection to store aggregation of CcShowHosts objects.
*/
@@ -199,12 +193,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
*/
protected $ccFilessRelatedByDbEditedbyScheduledForDeletion = null;
- /**
- * An array of objects scheduled for deletion.
- * @var PropelObjectCollection
- */
- protected $ccPermssScheduledForDeletion = null;
-
/**
* An array of objects scheduled for deletion.
* @var PropelObjectCollection
@@ -879,8 +867,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
$this->collCcFilessRelatedByDbEditedby = null;
- $this->collCcPermss = null;
-
$this->collCcShowHostss = null;
$this->collCcPlaylists = null;
@@ -1053,23 +1039,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
}
}
- if ($this->ccPermssScheduledForDeletion !== null) {
- if (!$this->ccPermssScheduledForDeletion->isEmpty()) {
- CcPermsQuery::create()
- ->filterByPrimaryKeys($this->ccPermssScheduledForDeletion->getPrimaryKeys(false))
- ->delete($con);
- $this->ccPermssScheduledForDeletion = null;
- }
- }
-
- if ($this->collCcPermss !== null) {
- foreach ($this->collCcPermss as $referrerFK) {
- if (!$referrerFK->isDeleted() && ($referrerFK->isNew() || $referrerFK->isModified())) {
- $affectedRows += $referrerFK->save($con);
- }
- }
- }
-
if ($this->ccShowHostssScheduledForDeletion !== null) {
if (!$this->ccShowHostssScheduledForDeletion->isEmpty()) {
CcShowHostsQuery::create()
@@ -1405,14 +1374,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
}
}
- if ($this->collCcPermss !== null) {
- foreach ($this->collCcPermss as $referrerFK) {
- if (!$referrerFK->validate($columns)) {
- $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
- }
- }
- }
-
if ($this->collCcShowHostss !== null) {
foreach ($this->collCcShowHostss as $referrerFK) {
if (!$referrerFK->validate($columns)) {
@@ -1590,9 +1551,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
if (null !== $this->collCcFilessRelatedByDbEditedby) {
$result['CcFilessRelatedByDbEditedby'] = $this->collCcFilessRelatedByDbEditedby->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
- if (null !== $this->collCcPermss) {
- $result['CcPermss'] = $this->collCcPermss->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
- }
if (null !== $this->collCcShowHostss) {
$result['CcShowHostss'] = $this->collCcShowHostss->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
}
@@ -1840,12 +1798,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
}
}
- foreach ($this->getCcPermss() as $relObj) {
- if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
- $copyObj->addCcPerms($relObj->copy($deepCopy));
- }
- }
-
foreach ($this->getCcShowHostss() as $relObj) {
if ($relObj !== $this) { // ensure that we don't try to copy a reference to ourselves
$copyObj->addCcShowHosts($relObj->copy($deepCopy));
@@ -1949,9 +1901,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
if ('CcFilesRelatedByDbEditedby' == $relationName) {
$this->initCcFilessRelatedByDbEditedby();
}
- if ('CcPerms' == $relationName) {
- $this->initCcPermss();
- }
if ('CcShowHosts' == $relationName) {
$this->initCcShowHostss();
}
@@ -2422,231 +2371,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
return $this;
}
- /**
- * Clears out the collCcPermss collection
- *
- * This does not modify the database; however, it will remove any associated objects, causing
- * them to be refetched by subsequent calls to accessor method.
- *
- * @return CcSubjs The current object (for fluent API support)
- * @see addCcPermss()
- */
- public function clearCcPermss()
- {
- $this->collCcPermss = null; // important to set this to null since that means it is uninitialized
- $this->collCcPermssPartial = null;
-
- return $this;
- }
-
- /**
- * reset is the collCcPermss collection loaded partially
- *
- * @return void
- */
- public function resetPartialCcPermss($v = true)
- {
- $this->collCcPermssPartial = $v;
- }
-
- /**
- * Initializes the collCcPermss collection.
- *
- * By default this just sets the collCcPermss collection to an empty array (like clearcollCcPermss());
- * however, you may wish to override this method in your stub class to provide setting appropriate
- * to your application -- for example, setting the initial array to the values stored in database.
- *
- * @param boolean $overrideExisting If set to true, the method call initializes
- * the collection even if it is not empty
- *
- * @return void
- */
- public function initCcPermss($overrideExisting = true)
- {
- if (null !== $this->collCcPermss && !$overrideExisting) {
- return;
- }
- $this->collCcPermss = new PropelObjectCollection();
- $this->collCcPermss->setModel('CcPerms');
- }
-
- /**
- * Gets an array of CcPerms objects which contain a foreign key that references this object.
- *
- * If the $criteria is not null, it is used to always fetch the results from the database.
- * Otherwise the results are fetched from the database the first time, then cached.
- * Next time the same method is called without $criteria, the cached collection is returned.
- * If this CcSubjs is new, it will return
- * an empty collection or the current collection; the criteria is ignored on a new object.
- *
- * @param Criteria $criteria optional Criteria object to narrow the query
- * @param PropelPDO $con optional connection object
- * @return PropelObjectCollection|CcPerms[] List of CcPerms objects
- * @throws PropelException
- */
- public function getCcPermss($criteria = null, PropelPDO $con = null)
- {
- $partial = $this->collCcPermssPartial && !$this->isNew();
- if (null === $this->collCcPermss || null !== $criteria || $partial) {
- if ($this->isNew() && null === $this->collCcPermss) {
- // return empty collection
- $this->initCcPermss();
- } else {
- $collCcPermss = CcPermsQuery::create(null, $criteria)
- ->filterByCcSubjs($this)
- ->find($con);
- if (null !== $criteria) {
- if (false !== $this->collCcPermssPartial && count($collCcPermss)) {
- $this->initCcPermss(false);
-
- foreach ($collCcPermss as $obj) {
- if (false == $this->collCcPermss->contains($obj)) {
- $this->collCcPermss->append($obj);
- }
- }
-
- $this->collCcPermssPartial = true;
- }
-
- $collCcPermss->getInternalIterator()->rewind();
-
- return $collCcPermss;
- }
-
- if ($partial && $this->collCcPermss) {
- foreach ($this->collCcPermss as $obj) {
- if ($obj->isNew()) {
- $collCcPermss[] = $obj;
- }
- }
- }
-
- $this->collCcPermss = $collCcPermss;
- $this->collCcPermssPartial = false;
- }
- }
-
- return $this->collCcPermss;
- }
-
- /**
- * Sets a collection of CcPerms objects related by a one-to-many relationship
- * to the current object.
- * It will also schedule objects for deletion based on a diff between old objects (aka persisted)
- * and new objects from the given Propel collection.
- *
- * @param PropelCollection $ccPermss A Propel collection.
- * @param PropelPDO $con Optional connection object
- * @return CcSubjs The current object (for fluent API support)
- */
- public function setCcPermss(PropelCollection $ccPermss, PropelPDO $con = null)
- {
- $ccPermssToDelete = $this->getCcPermss(new Criteria(), $con)->diff($ccPermss);
-
-
- $this->ccPermssScheduledForDeletion = $ccPermssToDelete;
-
- foreach ($ccPermssToDelete as $ccPermsRemoved) {
- $ccPermsRemoved->setCcSubjs(null);
- }
-
- $this->collCcPermss = null;
- foreach ($ccPermss as $ccPerms) {
- $this->addCcPerms($ccPerms);
- }
-
- $this->collCcPermss = $ccPermss;
- $this->collCcPermssPartial = false;
-
- return $this;
- }
-
- /**
- * Returns the number of related CcPerms objects.
- *
- * @param Criteria $criteria
- * @param boolean $distinct
- * @param PropelPDO $con
- * @return int Count of related CcPerms objects.
- * @throws PropelException
- */
- public function countCcPermss(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
- {
- $partial = $this->collCcPermssPartial && !$this->isNew();
- if (null === $this->collCcPermss || null !== $criteria || $partial) {
- if ($this->isNew() && null === $this->collCcPermss) {
- return 0;
- }
-
- if ($partial && !$criteria) {
- return count($this->getCcPermss());
- }
- $query = CcPermsQuery::create(null, $criteria);
- if ($distinct) {
- $query->distinct();
- }
-
- return $query
- ->filterByCcSubjs($this)
- ->count($con);
- }
-
- return count($this->collCcPermss);
- }
-
- /**
- * Method called to associate a CcPerms object to this object
- * through the CcPerms foreign key attribute.
- *
- * @param CcPerms $l CcPerms
- * @return CcSubjs The current object (for fluent API support)
- */
- public function addCcPerms(CcPerms $l)
- {
- if ($this->collCcPermss === null) {
- $this->initCcPermss();
- $this->collCcPermssPartial = true;
- }
-
- if (!in_array($l, $this->collCcPermss->getArrayCopy(), true)) { // only add it if the **same** object is not already associated
- $this->doAddCcPerms($l);
-
- if ($this->ccPermssScheduledForDeletion and $this->ccPermssScheduledForDeletion->contains($l)) {
- $this->ccPermssScheduledForDeletion->remove($this->ccPermssScheduledForDeletion->search($l));
- }
- }
-
- return $this;
- }
-
- /**
- * @param CcPerms $ccPerms The ccPerms object to add.
- */
- protected function doAddCcPerms($ccPerms)
- {
- $this->collCcPermss[]= $ccPerms;
- $ccPerms->setCcSubjs($this);
- }
-
- /**
- * @param CcPerms $ccPerms The ccPerms object to remove.
- * @return CcSubjs The current object (for fluent API support)
- */
- public function removeCcPerms($ccPerms)
- {
- if ($this->getCcPermss()->contains($ccPerms)) {
- $this->collCcPermss->remove($this->collCcPermss->search($ccPerms));
- if (null === $this->ccPermssScheduledForDeletion) {
- $this->ccPermssScheduledForDeletion = clone $this->collCcPermss;
- $this->ccPermssScheduledForDeletion->clear();
- }
- $this->ccPermssScheduledForDeletion[]= $ccPerms;
- $ccPerms->setCcSubjs(null);
- }
-
- return $this;
- }
-
/**
* Clears out the collCcShowHostss collection
*
@@ -4073,11 +3797,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
$o->clearAllReferences($deep);
}
}
- if ($this->collCcPermss) {
- foreach ($this->collCcPermss as $o) {
- $o->clearAllReferences($deep);
- }
- }
if ($this->collCcShowHostss) {
foreach ($this->collCcShowHostss as $o) {
$o->clearAllReferences($deep);
@@ -4120,10 +3839,6 @@ abstract class BaseCcSubjs extends BaseObject implements Persistent
$this->collCcFilessRelatedByDbEditedby->clearIterator();
}
$this->collCcFilessRelatedByDbEditedby = null;
- if ($this->collCcPermss instanceof PropelCollection) {
- $this->collCcPermss->clearIterator();
- }
- $this->collCcPermss = null;
if ($this->collCcShowHostss instanceof PropelCollection) {
$this->collCcShowHostss->clearIterator();
}
diff --git a/legacy/application/models/airtime/om/BaseCcSubjsPeer.php b/legacy/application/models/airtime/om/BaseCcSubjsPeer.php
index 83e2aef47..986c62a95 100644
--- a/legacy/application/models/airtime/om/BaseCcSubjsPeer.php
+++ b/legacy/application/models/airtime/om/BaseCcSubjsPeer.php
@@ -415,9 +415,6 @@ abstract class BaseCcSubjsPeer
*/
public static function clearRelatedInstancePool()
{
- // Invalidate objects in CcPermsPeer instance pool,
- // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
- CcPermsPeer::clearInstancePool();
// Invalidate objects in CcShowHostsPeer instance pool,
// since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule.
CcShowHostsPeer::clearInstancePool();
diff --git a/legacy/application/models/airtime/om/BaseCcSubjsQuery.php b/legacy/application/models/airtime/om/BaseCcSubjsQuery.php
index aae052046..413078dd1 100644
--- a/legacy/application/models/airtime/om/BaseCcSubjsQuery.php
+++ b/legacy/application/models/airtime/om/BaseCcSubjsQuery.php
@@ -46,10 +46,6 @@
* @method CcSubjsQuery rightJoinCcFilesRelatedByDbEditedby($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CcFilesRelatedByDbEditedby relation
* @method CcSubjsQuery innerJoinCcFilesRelatedByDbEditedby($relationAlias = null) Adds a INNER JOIN clause to the query using the CcFilesRelatedByDbEditedby relation
*
- * @method CcSubjsQuery leftJoinCcPerms($relationAlias = null) Adds a LEFT JOIN clause to the query using the CcPerms relation
- * @method CcSubjsQuery rightJoinCcPerms($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CcPerms relation
- * @method CcSubjsQuery innerJoinCcPerms($relationAlias = null) Adds a INNER JOIN clause to the query using the CcPerms relation
- *
* @method CcSubjsQuery leftJoinCcShowHosts($relationAlias = null) Adds a LEFT JOIN clause to the query using the CcShowHosts relation
* @method CcSubjsQuery rightJoinCcShowHosts($relationAlias = null) Adds a RIGHT JOIN clause to the query using the CcShowHosts relation
* @method CcSubjsQuery innerJoinCcShowHosts($relationAlias = null) Adds a INNER JOIN clause to the query using the CcShowHosts relation
@@ -878,80 +874,6 @@ abstract class BaseCcSubjsQuery extends ModelCriteria
->useQuery($relationAlias ? $relationAlias : 'CcFilesRelatedByDbEditedby', 'CcFilesQuery');
}
- /**
- * Filter the query by a related CcPerms object
- *
- * @param CcPerms|PropelObjectCollection $ccPerms the related object to use as filter
- * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
- *
- * @return CcSubjsQuery The current query, for fluid interface
- * @throws PropelException - if the provided filter is invalid.
- */
- public function filterByCcPerms($ccPerms, $comparison = null)
- {
- if ($ccPerms instanceof CcPerms) {
- return $this
- ->addUsingAlias(CcSubjsPeer::ID, $ccPerms->getSubj(), $comparison);
- } elseif ($ccPerms instanceof PropelObjectCollection) {
- return $this
- ->useCcPermsQuery()
- ->filterByPrimaryKeys($ccPerms->getPrimaryKeys())
- ->endUse();
- } else {
- throw new PropelException('filterByCcPerms() only accepts arguments of type CcPerms or PropelCollection');
- }
- }
-
- /**
- * Adds a JOIN clause to the query using the CcPerms relation
- *
- * @param string $relationAlias optional alias for the relation
- * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
- *
- * @return CcSubjsQuery The current query, for fluid interface
- */
- public function joinCcPerms($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
- {
- $tableMap = $this->getTableMap();
- $relationMap = $tableMap->getRelation('CcPerms');
-
- // create a ModelJoin object for this join
- $join = new ModelJoin();
- $join->setJoinType($joinType);
- $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
- if ($previousJoin = $this->getPreviousJoin()) {
- $join->setPreviousJoin($previousJoin);
- }
-
- // add the ModelJoin to the current object
- if ($relationAlias) {
- $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
- $this->addJoinObject($join, $relationAlias);
- } else {
- $this->addJoinObject($join, 'CcPerms');
- }
-
- return $this;
- }
-
- /**
- * Use the CcPerms relation CcPerms object
- *
- * @see useQuery()
- *
- * @param string $relationAlias optional alias for the relation,
- * to be used as main alias in the secondary query
- * @param string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
- *
- * @return CcPermsQuery A secondary query class using the current class as primary query
- */
- public function useCcPermsQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
- {
- return $this
- ->joinCcPerms($relationAlias, $joinType)
- ->useQuery($relationAlias ? $relationAlias : 'CcPerms', 'CcPermsQuery');
- }
-
/**
* Filter the query by a related CcShowHosts object
*
diff --git a/legacy/build/schema.xml b/legacy/build/schema.xml
index 40e89a4db..197038fca 100644
--- a/legacy/build/schema.xml
+++ b/legacy/build/schema.xml
@@ -109,28 +109,6 @@