Ejemplo n.º 1
0
 public static function doSelectFiltered(Criteria $criteria, $con = null)
 {
     $criteria->add(VSpecPeer::PARENT, 1, Criteria::IN);
     $c3 = $criteria->getCriterion(VSpecPeer::PARENT);
     $c4 = new Criterion($criteria, VSpecPeer::PARENT, 7, Criteria::IN);
     $c5 = new Criterion($criteria, VSpecPeer::PARENT, 0, Criteria::IN);
     $c4->addOr($c5);
     $c3->addOr($c4);
     $tmp_depts = VSpecPeer::doSelect($criteria);
     $depts = array();
     foreach ($tmp_depts as $key => $val) {
         $pi = $val->getParentalIndex();
         $prefix = '';
         for ($i = 0; $i < $val->level - 1; $i++) {
             $prefix .= ParamsPeer::retrieveByCode('tree_node_mark')->getValue();
         }
         $val->setCode($prefix . $val->getCode());
         $val->setDescription($prefix . $val->getDescription());
         $depts[$pi] = $val;
     }
     ksort($depts);
     $result = array();
     foreach ($depts as $r) {
         $result[] = $r;
     }
     return $result;
 }
Ejemplo n.º 2
0
 public function import()
 {
     $objPHPExcel = @PHPExcel_IOFactory::load($this->file->getTempName());
     /** @var PHPExcel_Worksheet $worksheet */
     foreach ($objPHPExcel->getWorksheetIterator() as $worksheet) {
         $rowIterator = $worksheet->getRowIterator();
         /** @var PHPExcel_Worksheet_Row $row  */
         foreach ($rowIterator as $row) {
             $criterion = new Criterion();
             $criterion->Decision = $this->decision;
             $cellIterator = $row->getCellIterator();
             $cellIterator->setIterateOnlyExistingCells();
             /** @var PHPExcel_Cell $cell*/
             foreach ($cellIterator as $cell) {
                 if (!is_null($cell)) {
                     $column = $cell->getColumn();
                     if ($column == 'A') {
                         $criterion->name = $cell->getValue();
                         $criterion->save();
                     } else {
                         if ($column == 'B') {
                             $criterion->description = $cell->getValue();
                             $criterion->save();
                         }
                     }
                 }
             }
         }
     }
 }
Ejemplo n.º 3
0
 /**
  * @param Criterion $criterion
  * @return bool
  */
 public function canAdd(Criterion $criterion)
 {
     $allowedKeys = $this->getAllowedKeys();
     if (empty($allowedKeys)) {
         return true;
     }
     return in_array($criterion->getKey(), $allowedKeys);
 }
Ejemplo n.º 4
0
 public function getCompaniesWithStatusCriteria($status)
 {
     $criteria = new SelectCriteria($this->getDomain());
     $statusCriteria = Criterion::_eq($this->getDomain(), "status", $status);
     $criteria->setCriteria($statusCriteria);
     return $criteria;
 }
 public function __construct($id = null, $type = null, $CriterionType = null)
 {
     parent::__construct();
     $this->id = $id;
     $this->type = $type;
     $this->CriterionType = $CriterionType;
 }
Ejemplo n.º 6
0
 public function getEntityWithLowerPosition(Page $movedEntity)
 {
     $criteria = new SelectCriteria($this->getDomain());
     $criteria->setCriteria(Criterion::_gt($this->getDomain(), "position", $movedEntity->getPosition()));
     $criteria->addTransformer(Transformer::_limit(1));
     $criteria->addTransformer(Transformer::_orderBy($this->getDomain(), "position", false));
     return $criteria->toUnique();
 }
 public function __construct($name = null, $countryCode = null, $id = null, $type = null, $CriterionType = null)
 {
     parent::__construct();
     $this->name = $name;
     $this->countryCode = $countryCode;
     $this->id = $id;
     $this->type = $type;
     $this->CriterionType = $CriterionType;
 }
 public function __construct($channelId = null, $channelName = null, $id = null, $type = null, $CriterionType = null)
 {
     parent::__construct();
     $this->channelId = $channelId;
     $this->channelName = $channelName;
     $this->id = $id;
     $this->type = $type;
     $this->CriterionType = $CriterionType;
 }
 public function __construct($feedId = null, $matchingFunction = null, $id = null, $type = null, $CriterionType = null)
 {
     parent::__construct();
     $this->feedId = $feedId;
     $this->matchingFunction = $matchingFunction;
     $this->id = $id;
     $this->type = $type;
     $this->CriterionType = $CriterionType;
 }
 public function __construct($userInterestId = null, $userInterestName = null, $id = null, $type = null, $CriterionType = null)
 {
     parent::__construct();
     $this->userInterestId = $userInterestId;
     $this->userInterestName = $userInterestName;
     $this->id = $id;
     $this->type = $type;
     $this->CriterionType = $CriterionType;
 }
 public function __construct($mobileAppCategoryId = null, $displayName = null, $id = null, $type = null, $CriterionType = null)
 {
     parent::__construct();
     $this->mobileAppCategoryId = $mobileAppCategoryId;
     $this->displayName = $displayName;
     $this->id = $id;
     $this->type = $type;
     $this->CriterionType = $CriterionType;
 }
Ejemplo n.º 12
0
 public function __construct($text = null, $locale = null, $id = null, $type = null, $CriterionType = null)
 {
     parent::__construct();
     $this->text = $text;
     $this->locale = $locale;
     $this->id = $id;
     $this->type = $type;
     $this->CriterionType = $CriterionType;
 }
 public function __construct($appId = null, $displayName = null, $id = null, $type = null, $CriterionType = null)
 {
     parent::__construct();
     $this->appId = $appId;
     $this->displayName = $displayName;
     $this->id = $id;
     $this->type = $type;
     $this->CriterionType = $CriterionType;
 }
 public function __construct($conditions = null, $text = null, $id = null, $type = null, $CriterionType = null)
 {
     parent::__construct();
     $this->conditions = $conditions;
     $this->text = $text;
     $this->id = $id;
     $this->type = $type;
     $this->CriterionType = $CriterionType;
 }
 public function __construct($partitionType = null, $parentCriterionId = null, $caseValue = null, $id = null, $type = null, $CriterionType = null)
 {
     parent::__construct();
     $this->partitionType = $partitionType;
     $this->parentCriterionId = $parentCriterionId;
     $this->caseValue = $caseValue;
     $this->id = $id;
     $this->type = $type;
     $this->CriterionType = $CriterionType;
 }
 public function __construct($parameter = null, $criteriaCoverage = null, $criteriaSamples = null, $id = null, $type = null, $CriterionType = null)
 {
     parent::__construct();
     $this->parameter = $parameter;
     $this->criteriaCoverage = $criteriaCoverage;
     $this->criteriaSamples = $criteriaSamples;
     $this->id = $id;
     $this->type = $type;
     $this->CriterionType = $CriterionType;
 }
Ejemplo n.º 17
0
 public function __construct($verticalId = null, $verticalParentId = null, $path = null, $id = null, $type = null, $CriterionType = null)
 {
     parent::__construct();
     $this->verticalId = $verticalId;
     $this->verticalParentId = $verticalParentId;
     $this->path = $path;
     $this->id = $id;
     $this->type = $type;
     $this->CriterionType = $CriterionType;
 }
Ejemplo n.º 18
0
 public function getResetTokenByUserId($userId, $token)
 {
     $criteria = new SelectCriteria($this->getDomain());
     $userCriteria = Criterion::_eq($this->getDomain(), "userId", $userId);
     $tokenCriteria = Criterion::_eq($this->getDomain(), "token", $token);
     $creationDate = Criterion::_gt($this->getDomain(), "creationDate", $this->getDateTime("-1 day"));
     $tokenDetailsCriteria = Criterion::_and($userCriteria, $tokenCriteria);
     $criteria->setCriteria(Criterion::_and($tokenDetailsCriteria, $creationDate));
     return $criteria->toUnique();
 }
 /**
  * @param $userToken
  * @return MoldPAuthToken
  */
 private function getValidationTokenByToken($userToken)
 {
     $criteria = new SelectCriteria($this->getDomain());
     $userTokenCriterion = Criterion::_eq($this->getDomain(), "userToken", $userToken);
     $lastActiveDate = Criterion::_gt($this->getDomain(), "lastActiveDate", $this->getDateTime("-2 hours"));
     $creationDate = Criterion::_gt($this->getDomain(), "creationDate", $this->getDateTime("-1 day"));
     $dateCriteria = Criterion::_or($lastActiveDate, $creationDate);
     $criteria->setCriteria(Criterion::_and($userTokenCriterion, $dateCriteria));
     return $criteria->toUnique();
 }
Ejemplo n.º 20
0
 public function __construct($keywordSetId = null, $name = null, $deprecated = null, $id = null, $type = null, $CriterionType = null)
 {
     parent::__construct();
     $this->keywordSetId = $keywordSetId;
     $this->name = $name;
     $this->deprecated = $deprecated;
     $this->id = $id;
     $this->type = $type;
     $this->CriterionType = $CriterionType;
 }
Ejemplo n.º 21
0
 public function getEntityWithLowerPosition(PageComponent $movedEntity)
 {
     $criteria = new SelectCriteria($this->getDomain());
     $positionCriteria = Criterion::_gt($this->getDomain(), "position", $movedEntity->getPosition());
     $columnCriteria = Criterion::_eq($this->getDomain(), "pageColumnId", $movedEntity->getPageColumnId());
     $criteria->setCriteria(Criterion::_and($positionCriteria, $columnCriteria));
     $criteria->addTransformer(Transformer::_limit(1));
     $criteria->addTransformer(Transformer::_orderBy($this->getDomain(), "position", false));
     return $criteria->toUnique();
 }
 public function __construct($userListId = null, $userListName = null, $userListMembershipStatus = null, $id = null, $type = null, $CriterionType = null)
 {
     parent::__construct();
     $this->userListId = $userListId;
     $this->userListName = $userListName;
     $this->userListMembershipStatus = $userListMembershipStatus;
     $this->id = $id;
     $this->type = $type;
     $this->CriterionType = $CriterionType;
 }
 public function __construct($deviceName = null, $manufacturerName = null, $deviceType = null, $operatingSystemName = null, $id = null, $type = null, $CriterionType = null)
 {
     parent::__construct();
     $this->deviceName = $deviceName;
     $this->manufacturerName = $manufacturerName;
     $this->deviceType = $deviceType;
     $this->operatingSystemName = $operatingSystemName;
     $this->id = $id;
     $this->type = $type;
     $this->CriterionType = $CriterionType;
 }
 public function __construct($locationName = null, $displayType = null, $targetingStatus = null, $parentLocations = null, $id = null, $type = null, $CriterionType = null)
 {
     parent::__construct();
     $this->locationName = $locationName;
     $this->displayType = $displayType;
     $this->targetingStatus = $targetingStatus;
     $this->parentLocations = $parentLocations;
     $this->id = $id;
     $this->type = $type;
     $this->CriterionType = $CriterionType;
 }
 public function __construct($geoPoint = null, $radiusDistanceUnits = null, $radiusInUnits = null, $address = null, $id = null, $type = null, $CriterionType = null)
 {
     parent::__construct();
     $this->geoPoint = $geoPoint;
     $this->radiusDistanceUnits = $radiusDistanceUnits;
     $this->radiusInUnits = $radiusInUnits;
     $this->address = $address;
     $this->id = $id;
     $this->type = $type;
     $this->CriterionType = $CriterionType;
 }
 public function __construct($name = null, $osMajorVersion = null, $osMinorVersion = null, $operatorType = null, $id = null, $type = null, $CriterionType = null)
 {
     parent::__construct();
     $this->name = $name;
     $this->osMajorVersion = $osMajorVersion;
     $this->osMinorVersion = $osMinorVersion;
     $this->operatorType = $operatorType;
     $this->id = $id;
     $this->type = $type;
     $this->CriterionType = $CriterionType;
 }
 public function __construct($dayOfWeek = null, $startHour = null, $startMinute = null, $endHour = null, $endMinute = null, $id = null, $type = null, $CriterionType = null)
 {
     parent::__construct();
     $this->dayOfWeek = $dayOfWeek;
     $this->startHour = $startHour;
     $this->startMinute = $startMinute;
     $this->endHour = $endHour;
     $this->endMinute = $endMinute;
     $this->id = $id;
     $this->type = $type;
     $this->CriterionType = $CriterionType;
 }
 public function __construct($userListId = null, $userListName = null, $userListMembershipStatus = null, $userListEligibleForSearch = null, $userListEligibleForDisplay = null, $id = null, $type = null, $CriterionType = null)
 {
     parent::__construct();
     $this->userListId = $userListId;
     $this->userListName = $userListName;
     $this->userListMembershipStatus = $userListMembershipStatus;
     $this->userListEligibleForSearch = $userListEligibleForSearch;
     $this->userListEligibleForDisplay = $userListEligibleForDisplay;
     $this->id = $id;
     $this->type = $type;
     $this->CriterionType = $CriterionType;
 }
Ejemplo n.º 29
0
 /**
  * Should the given experiment be enabled in the current context?
  *
  * @param array $experimentData
  * @return boolean
  */
 static function isEnabled(array $experimentData)
 {
     if (empty($experimentData['criteria'])) {
         return false;
     }
     foreach ($experimentData['criteria'] as $criterion => $value) {
         if (!Criterion::factory($criterion)->matches($value)) {
             return false;
         }
     }
     return true;
 }
Ejemplo n.º 30
0
 /**
  * add inner criteria for criterions 
  * ----------------- IMPORTANT ----------------- 
  *  for this to work - we have to change the access modifier of the Creterion::getClauses() function from private to public
  * It's in the Criteria.php file under
  * 	/symfony/vendor/propel/util/Criteria.php 
  */
 private function addClauses(Criteria $criteria_to_filter, Criterion $filter_criterion, Criterion $crit)
 {
     $conjunctions = $filter_criterion->getConjunctions();
     if (count($conjunctions) < 1) {
         return;
     }
     $clauses = $filter_criterion->getClauses();
     $i = 0;
     foreach ($clauses as $clause) {
         $new_crit = $criteria_to_filter->getNewCriterion($clause->getTable() . "." . $clause->getColumn(), $clause->getValue(), $clause->getComparison());
         $conj = @$conjunctions[$i];
         if ($conj == Criterion::UND) {
             $crit->addAnd($new_crit);
         } elseif ($conj == Criterion::ODER) {
             $crit->addOr($new_crit);
         }
         $i++;
     }
 }