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(); } }
public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser) { // TODO - verify permissions for viewing lists $detailed = $this->getP("detailed", false); $limit = $this->getP("page_size", 10); $page = $this->getP("page", 1); //$order_by = int( $this->getP ( "order_by" , -1 ) ); $offset = ($page - 1) * $limit; // kuserPeer::setUseCriteriaFilter( false ); $c = new Criteria(); // filter $filter = new moderationFilter(); $fields_set = $filter->fillObjectFromRequest($this->getInputParams(), "filter_", null); $filter->attachToCriteria($c); //if ($order_by != -1) kshowPeer::setOrder( $c , $order_by ); $count = moderationPeer::doCount($c); $offset = ($page - 1) * $limit; $c->setLimit($limit); if ($offset > 0) { $c->setOffset($offset); } $list = moderationPeer::doSelect($c); $level = objectWrapperBase::DETAIL_LEVEL_REGULAR; $this->addMsg("count", $count); $this->addMsg("page_size", $limit); $this->addMsg("page", $page); $wrapper = objectWrapperBase::getWrapperClass($list, $level); $this->addMsg("moderations", $wrapper); }
public function executeImpl($partner_id, $subp_id, $puser_id, $partner_prefix, $puser_kuser) { $moderation_id = $this->getPM("moderation_id"); $moderation_status = $this->getPM("moderation_status"); $moderation = moderationPeer::retrieveByPK($moderation_id); if ($moderation) { $moderation->updateStatus($moderation_status); } }
/** * update all moderations for the object defined by object that has the status PENDING OR REVIEW * * @param Criteria $object * @param Criteria $status * @return void */ public static function updateModerationsForObject($object, $status) { if ($object instanceof entry) { $entry = $object; $c = new Criteria(); $c->add(moderationPeer::OBJECT_ID, $entry->getId()); $c->add(moderationPeer::OBJECT_TYPE, moderation::MODERATION_OBJECT_TYPE_ENTRY); $crit = $c->getNewCriterion(moderationPeer::STATUS, moderation::MODERATION_STATUS_PENDING); $crit->addOr($c->getNewCriterion(moderationPeer::STATUS, moderation::MODERATION_STATUS_REVIEW)); $c->add($crit); // $c->add ( moderationPeer::PARTNER_ID , $entry->getPartnerId() ); // $new_status = new Criteria(); $new_status->add(moderationPeer::STATUS, $status); // this will update the moderation objects WITHOUT going through save() // this will prevent a silly loop of updating the moderation -> entry -> moderation ... return moderationPeer::doUpdateAllModerations($c, $new_status); } elseif ($object instanceof kshow) { throw new exception("TO BE IMPLEMENTED addToModerationList - for type kshow"); } else { // ERROR ! throw new exception("TO BE IMPLEMENTED addToModerationList - for type unknown type"); } }
/** * Returns the number of related moderation objects. * * @param Criteria $criteria * @param boolean $distinct * @param PropelPDO $con * @return int Count of related moderation objects. * @throws PropelException */ public function countmoderations(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) { if ($criteria === null) { $criteria = new Criteria(kuserPeer::DATABASE_NAME); } else { $criteria = clone $criteria; } if ($distinct) { $criteria->setDistinct(); } $count = null; if ($this->collmoderations === null) { if ($this->isNew()) { $count = 0; } else { $criteria->add(moderationPeer::KUSER_ID, $this->id); $count = moderationPeer::doCount($criteria, false, $con); } } else { // criteria has no effect for a new object if (!$this->isNew()) { // the following code is to determine if a new query is // called for. If the criteria is the same as the last // one, just return count of the collection. $criteria->add(moderationPeer::KUSER_ID, $this->id); if (!isset($this->lastmoderationCriteria) || !$this->lastmoderationCriteria->equals($criteria)) { $count = moderationPeer::doCount($criteria, false, $con); } else { $count = count($this->collmoderations); } } else { $count = count($this->collmoderations); } } return $count; }
/** * 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 = moderationPeer::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) { $this->setId($arr[$keys[0]]); } if (array_key_exists($keys[1], $arr)) { $this->setPartnerId($arr[$keys[1]]); } if (array_key_exists($keys[2], $arr)) { $this->setSubpId($arr[$keys[2]]); } if (array_key_exists($keys[3], $arr)) { $this->setObjectId($arr[$keys[3]]); } if (array_key_exists($keys[4], $arr)) { $this->setObjectType($arr[$keys[4]]); } if (array_key_exists($keys[5], $arr)) { $this->setKuserId($arr[$keys[5]]); } if (array_key_exists($keys[6], $arr)) { $this->setPuserId($arr[$keys[6]]); } if (array_key_exists($keys[7], $arr)) { $this->setStatus($arr[$keys[7]]); } if (array_key_exists($keys[8], $arr)) { $this->setCreatedAt($arr[$keys[8]]); } if (array_key_exists($keys[9], $arr)) { $this->setUpdatedAt($arr[$keys[9]]); } if (array_key_exists($keys[10], $arr)) { $this->setComments($arr[$keys[10]]); } if (array_key_exists($keys[11], $arr)) { $this->setGroupId($arr[$keys[11]]); } if (array_key_exists($keys[12], $arr)) { $this->setReportCode($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(moderationPeer::DATABASE_NAME); $criteria->add(moderationPeer::ID, $this->id); if ($this->alreadyInSave && count($this->modifiedColumns) == 2 && $this->isColumnModified(moderationPeer::UPDATED_AT)) { $theModifiedColumn = null; foreach ($this->modifiedColumns as $modifiedColumn) { if ($modifiedColumn != moderationPeer::UPDATED_AT) { $theModifiedColumn = $modifiedColumn; } } $atomicColumns = moderationPeer::getAtomicColumns(); if (in_array($theModifiedColumn, $atomicColumns)) { $criteria->add($theModifiedColumn, $this->getByName($theModifiedColumn, BasePeer::TYPE_COLNAME), Criteria::NOT_EQUAL); } } return $criteria; }
/** * 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(moderationPeer::DATABASE_NAME); $criteria->add(moderationPeer::ID, $pks, Criteria::IN); $objs = moderationPeer::doSelect($criteria, $con); } return $objs; }
public function getFieldNameFromPeer($field_name) { $res = moderationPeer::translateFieldName($field_name, $this->field_name_translation_type, BasePeer::TYPE_COLNAME); return $res; }