public static function setDefaultCriteriaFilter() { if (self::$s_criteria_filter == null) { self::$s_criteria_filter = new criteriaFilter(); } $c = new Criteria(); $c->add(ScheduledTaskProfilePeer::STATUS, ScheduledTaskProfileStatus::DELETED, Criteria::NOT_EQUAL); self::$s_criteria_filter->setFilter($c); }
/** * 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(ScheduledTaskProfilePeer::DATABASE_NAME); $criteria->add(ScheduledTaskProfilePeer::ID, $this->id); if ($this->alreadyInSave) { if (count($this->modifiedColumns) == 2 && $this->isColumnModified(ScheduledTaskProfilePeer::UPDATED_AT)) { $theModifiedColumn = null; foreach ($this->modifiedColumns as $modifiedColumn) { if ($modifiedColumn != ScheduledTaskProfilePeer::UPDATED_AT) { $theModifiedColumn = $modifiedColumn; } } $atomicColumns = ScheduledTaskProfilePeer::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(ScheduledTaskProfilePeer::DATABASE_NAME); $criteria->add(ScheduledTaskProfilePeer::ID, $pks, Criteria::IN); $objs = ScheduledTaskProfilePeer::doSelect($criteria, $con); } return $objs; }
protected function getFieldNameFromPeer($fieldName) { $res = ScheduledTaskProfilePeer::translateFieldName($fieldName, $this->field_name_translation_type, BasePeer::TYPE_COLNAME); return $res; }
/** * * * @action requestDryRun * @param int $scheduledTaskProfileId * @param int $maxResults * @return int * * @throws KalturaScheduledTaskErrors::SCHEDULED_TASK_PROFILE_NOT_FOUND */ public function requestDryRunAction($scheduledTaskProfileId, $maxResults = 500) { // get the object $dbScheduledTaskProfile = ScheduledTaskProfilePeer::retrieveByPK($scheduledTaskProfileId); if (!$dbScheduledTaskProfile) { throw new KalturaAPIException(KalturaScheduledTaskErrors::SCHEDULED_TASK_PROFILE_NOT_FOUND, $scheduledTaskProfileId); } if (!in_array($dbScheduledTaskProfile->getStatus(), array(KalturaScheduledTaskProfileStatus::ACTIVE, KalturaScheduledTaskProfileStatus::DRY_RUN_ONLY))) { throw new KalturaAPIException(KalturaScheduledTaskErrors::SCHEDULED_TASK_DRY_RUN_NOT_ALLOWED, $scheduledTaskProfileId); } $jobData = new kScheduledTaskJobData(); $jobData->setMaxResults($maxResults); $referenceTime = kCurrentContext::$ks_object->getPrivilegeValue(ks::PRIVILEGE_REFERENCE_TIME); if ($referenceTime) { $jobData->setReferenceTime($referenceTime); } $batchJob = $this->createScheduledTaskJob($dbScheduledTaskProfile, $jobData); return $batchJob->getId(); }