public static function deleteBySchedulerConfigId($schedulerId) { $criteria = new Criteria(); $criteria->add(SchedulerPeer::CONFIGURED_ID, $schedulerId); SchedulerPeer::doDelete($criteria); SchedulerWorkerPeer::deleteBySchedulerConfigId($schedulerId); SchedulerConfigPeer::deleteBySchedulerConfigId($schedulerId); SchedulerStatusPeer::deleteBySchedulerConfigId($schedulerId); ControlPanelCommandPeer::deleteBySchedulerConfigId($schedulerId); }
/** * batch getCommand action returns the command with its current status * * @action getCommand * @param int $commandId The id of the command * @return KalturaControlPanelCommand */ function getCommandAction($commandId) { // finds command in the DB $commandDb = ControlPanelCommandPeer::retrieveByPK($commandId); if (!$commandDb) { throw new KalturaAPIException(KalturaErrors::COMMAND_NOT_FOUND, $commandId); } // returns the command $command = new KalturaControlPanelCommand(); $command->fromObject($commandDb, $this->getResponseProfile()); return $command; }
public static function deleteBySchedulerConfigId($schedulerId) { $criteria = new Criteria(); $criteria->add(ControlPanelCommandPeer::SCHEDULER_CONFIGURED_ID, $schedulerId); ControlPanelCommandPeer::doDelete($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(ControlPanelCommandPeer::DATABASE_NAME); $criteria->add(ControlPanelCommandPeer::ID, $this->id); if ($this->alreadyInSave && count($this->modifiedColumns) == 2 && $this->isColumnModified(ControlPanelCommandPeer::UPDATED_AT)) { $theModifiedColumn = null; foreach ($this->modifiedColumns as $modifiedColumn) { if ($modifiedColumn != ControlPanelCommandPeer::UPDATED_AT) { $theModifiedColumn = $modifiedColumn; } } $atomicColumns = ControlPanelCommandPeer::getAtomicColumns(); if (in_array($theModifiedColumn, $atomicColumns)) { $criteria->add($theModifiedColumn, $this->getByName($theModifiedColumn, BasePeer::TYPE_COLNAME), Criteria::NOT_EQUAL); } } return $criteria; }
public function getFieldNameFromPeer($field_name) { $res = ControlPanelCommandPeer::translateFieldName($field_name, $this->field_name_translation_type, BasePeer::TYPE_COLNAME); return $res; }
/** * 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 phpname (e.g. 'AuthorId') * * @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 = ControlPanelCommandPeer::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) { $this->setId($arr[$keys[0]]); } if (array_key_exists($keys[1], $arr)) { $this->setCreatedAt($arr[$keys[1]]); } if (array_key_exists($keys[2], $arr)) { $this->setCreatedBy($arr[$keys[2]]); } if (array_key_exists($keys[3], $arr)) { $this->setUpdatedAt($arr[$keys[3]]); } if (array_key_exists($keys[4], $arr)) { $this->setUpdatedBy($arr[$keys[4]]); } if (array_key_exists($keys[5], $arr)) { $this->setCreatedById($arr[$keys[5]]); } if (array_key_exists($keys[6], $arr)) { $this->setSchedulerId($arr[$keys[6]]); } if (array_key_exists($keys[7], $arr)) { $this->setSchedulerConfiguredId($arr[$keys[7]]); } if (array_key_exists($keys[8], $arr)) { $this->setWorkerId($arr[$keys[8]]); } if (array_key_exists($keys[9], $arr)) { $this->setWorkerConfiguredId($arr[$keys[9]]); } if (array_key_exists($keys[10], $arr)) { $this->setWorkerName($arr[$keys[10]]); } if (array_key_exists($keys[11], $arr)) { $this->setBatchIndex($arr[$keys[11]]); } if (array_key_exists($keys[12], $arr)) { $this->setType($arr[$keys[12]]); } if (array_key_exists($keys[13], $arr)) { $this->setTargetType($arr[$keys[13]]); } if (array_key_exists($keys[14], $arr)) { $this->setStatus($arr[$keys[14]]); } if (array_key_exists($keys[15], $arr)) { $this->setCause($arr[$keys[15]]); } if (array_key_exists($keys[16], $arr)) { $this->setDescription($arr[$keys[16]]); } if (array_key_exists($keys[17], $arr)) { $this->setErrorDescription($arr[$keys[17]]); } }
public static function clearMemory() { accessControlPeer::clearInstancePool(); kuserPeer::clearInstancePool(); kshowPeer::clearInstancePool(); entryPeer::clearInstancePool(); // kvotePeer::clearInstancePool(); // commentPeer::clearInstancePool(); // flagPeer::clearInstancePool(); // favoritePeer::clearInstancePool(); // KshowKuserPeer::clearInstancePool(); // MailJobPeer::clearInstancePool(); SchedulerPeer::clearInstancePool(); SchedulerWorkerPeer::clearInstancePool(); SchedulerStatusPeer::clearInstancePool(); SchedulerConfigPeer::clearInstancePool(); ControlPanelCommandPeer::clearInstancePool(); BatchJobPeer::clearInstancePool(); // PriorityGroupPeer::clearInstancePool(); BulkUploadResultPeer::clearInstancePool(); // blockedEmailPeer::clearInstancePool(); // conversionPeer::clearInstancePool(); // flickrTokenPeer::clearInstancePool(); PuserKuserPeer::clearInstancePool(); // PuserRolePeer::clearInstancePool(); PartnerPeer::clearInstancePool(); // WidgetLogPeer::clearInstancePool(); // adminKuserPeer::clearInstancePool(); // notificationPeer::clearInstancePool(); moderationPeer::clearInstancePool(); moderationFlagPeer::clearInstancePool(); roughcutEntryPeer::clearInstancePool(); // widgetPeer::clearInstancePool(); uiConfPeer::clearInstancePool(); // PartnerStatsPeer::clearInstancePool(); // PartnerActivityPeer::clearInstancePool(); ConversionProfilePeer::clearInstancePool(); // ConversionParamsPeer::clearInstancePool(); // KceInstallationErrorPeer::clearInstancePool(); FileSyncPeer::clearInstancePool(); accessControlPeer::clearInstancePool(); mediaInfoPeer::clearInstancePool(); assetParamsPeer::clearInstancePool(); assetParamsOutputPeer::clearInstancePool(); assetPeer::clearInstancePool(); conversionProfile2Peer::clearInstancePool(); flavorParamsConversionProfilePeer::clearInstancePool(); categoryPeer::clearInstancePool(); syndicationFeedPeer::clearInstancePool(); TrackEntryPeer::clearInstancePool(); // SystemUserPeer::clearInstancePool(); StorageProfilePeer::clearInstancePool(); // EmailIngestionProfilePeer::clearInstancePool(); UploadTokenPeer::clearInstancePool(); // invalidSessionPeer::clearInstancePool(); DynamicEnumPeer::clearInstancePool(); UserLoginDataPeer::clearInstancePool(); PermissionPeer::clearInstancePool(); UserRolePeer::clearInstancePool(); PermissionItemPeer::clearInstancePool(); PermissionToPermissionItemPeer::clearInstancePool(); KuserToUserRolePeer::clearInstancePool(); $pluginInstances = KalturaPluginManager::getPluginInstances('IKalturaMemoryCleaner'); foreach ($pluginInstances as $pluginInstance) { $pluginInstance->cleanMemory(); } if (function_exists('gc_collect_cycles')) { // php 5.3 and above gc_collect_cycles(); } }
/** * Retrieve multiple objects by pkey. * * @param array $pks List of primary keys * @param PropelPDO $con the connection to use * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. */ public static function retrieveByPKs($pks, PropelPDO $con = null) { $objs = null; if (empty($pks)) { $objs = array(); } else { $criteria = new Criteria(ControlPanelCommandPeer::DATABASE_NAME); $criteria->add(ControlPanelCommandPeer::ID, $pks, Criteria::IN); $objs = ControlPanelCommandPeer::doSelect($criteria, $con); } return $objs; }