public function clearMemory()
 {
     accessControlPeer::clearInstancePool();
     BatchJobPeer::clearInstancePool();
     BulkUploadResultPeer::clearInstancePool();
     categoryPeer::clearInstancePool();
     EmailIngestionProfilePeer::clearInstancePool();
     entryPeer::clearInstancePool();
     FileSyncPeer::clearInstancePool();
     flavorAssetPeer::clearInstancePool();
     flavorParamsConversionProfilePeer::clearInstancePool();
     flavorParamsOutputPeer::clearInstancePool();
     flavorParamsPeer::clearInstancePool();
     kshowPeer::clearInstancePool();
     mediaInfoPeer::clearInstancePool();
     moderationFlagPeer::clearInstancePool();
     moderationPeer::clearInstancePool();
     notificationPeer::clearInstancePool();
     roughcutEntryPeer::clearInstancePool();
     SchedulerConfigPeer::clearInstancePool();
     SchedulerPeer::clearInstancePool();
     SchedulerStatusPeer::clearInstancePool();
     SchedulerWorkerPeer::clearInstancePool();
     StorageProfilePeer::clearInstancePool();
     syndicationFeedPeer::clearInstancePool();
     TrackEntryPeer::clearInstancePool();
     uiConfPeer::clearInstancePool();
     UploadTokenPeer::clearInstancePool();
     // TODO clear default filters
     // TODO call all memory cleaner plugins
     if (function_exists('gc_collect_cycles')) {
         // php 5.3 and above
         gc_collect_cycles();
     }
 }
Exemple #2
0
 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);
 }
Exemple #3
0
 public function getWorkers()
 {
     $c = new Criteria();
     $c->add(SchedulerWorkerPeer::SCHEDULER_ID, $this->id);
     return SchedulerWorkerPeer::doSelect($c, myDbHelper::getConnection(myDbHelper::DB_HELPER_CONN_PROPEL2));
 }
 /**
  * list all Workers
  * 
  * @action listWorkers
  * @return KalturaSchedulerWorkerListResponse
  */
 function listWorkersAction()
 {
     $c = new Criteria();
     $count = SchedulerWorkerPeer::doCount($c, false, myDbHelper::getConnection(myDbHelper::DB_HELPER_CONN_PROPEL2));
     $list = SchedulerWorkerPeer::doSelect($c, myDbHelper::getConnection(myDbHelper::DB_HELPER_CONN_PROPEL2));
     $newList = KalturaSchedulerWorkerArray::fromDbArray($list, $this->getResponseProfile());
     $response = new KalturaSchedulerWorkerListResponse();
     $response->objects = $newList;
     $response->totalCount = $count;
     return $response;
 }
 /**
  * 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(SchedulerWorkerPeer::DATABASE_NAME);
         $criteria->add(SchedulerWorkerPeer::ID, $pks, Criteria::IN);
         $objs = SchedulerWorkerPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
 /**
  * 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 = SchedulerWorkerPeer::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->setSchedulerId($arr[$keys[5]]);
     }
     if (array_key_exists($keys[6], $arr)) {
         $this->setSchedulerConfiguredId($arr[$keys[6]]);
     }
     if (array_key_exists($keys[7], $arr)) {
         $this->setConfiguredId($arr[$keys[7]]);
     }
     if (array_key_exists($keys[8], $arr)) {
         $this->setType($arr[$keys[8]]);
     }
     if (array_key_exists($keys[9], $arr)) {
         $this->setName($arr[$keys[9]]);
     }
     if (array_key_exists($keys[10], $arr)) {
         $this->setDescription($arr[$keys[10]]);
     }
     if (array_key_exists($keys[11], $arr)) {
         $this->setStatuses($arr[$keys[11]]);
     }
     if (array_key_exists($keys[12], $arr)) {
         $this->setLastStatus($arr[$keys[12]]);
     }
 }
 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();
     }
 }
 /**
  * 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(SchedulerWorkerPeer::DATABASE_NAME);
     $criteria->add(SchedulerWorkerPeer::ID, $this->id);
     if ($this->alreadyInSave && count($this->modifiedColumns) == 2 && $this->isColumnModified(SchedulerWorkerPeer::UPDATED_AT)) {
         $theModifiedColumn = null;
         foreach ($this->modifiedColumns as $modifiedColumn) {
             if ($modifiedColumn != SchedulerWorkerPeer::UPDATED_AT) {
                 $theModifiedColumn = $modifiedColumn;
             }
         }
         $atomicColumns = SchedulerWorkerPeer::getAtomicColumns();
         if (in_array($theModifiedColumn, $atomicColumns)) {
             $criteria->add($theModifiedColumn, $this->getByName($theModifiedColumn, BasePeer::TYPE_COLNAME), Criteria::NOT_EQUAL);
         }
     }
     return $criteria;
 }
 public static function deleteBySchedulerConfigId($schedulerId)
 {
     $criteria = new Criteria();
     $criteria->add(SchedulerWorkerPeer::SCHEDULER_CONFIGURED_ID, $schedulerId);
     SchedulerWorkerPeer::doDelete($criteria);
 }