本文整理汇总了PHP中Criterion类的典型用法代码示例。如果您正苦于以下问题:PHP Criterion类的具体用法?PHP Criterion怎么用?PHP Criterion使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Criterion类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doSelectFiltered
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;
}
示例2: import
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();
}
}
}
}
}
}
}
示例3: canAdd
/**
* @param Criterion $criterion
* @return bool
*/
public function canAdd(Criterion $criterion)
{
$allowedKeys = $this->getAllowedKeys();
if (empty($allowedKeys)) {
return true;
}
return in_array($criterion->getKey(), $allowedKeys);
}
示例4: getCompaniesWithStatusCriteria
public function getCompaniesWithStatusCriteria($status)
{
$criteria = new SelectCriteria($this->getDomain());
$statusCriteria = Criterion::_eq($this->getDomain(), "status", $status);
$criteria->setCriteria($statusCriteria);
return $criteria;
}
示例5: __construct
public function __construct($id = null, $type = null, $CriterionType = null)
{
parent::__construct();
$this->id = $id;
$this->type = $type;
$this->CriterionType = $CriterionType;
}
示例6: getEntityWithLowerPosition
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();
}
示例7: __construct
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;
}
示例8: __construct
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;
}
示例9: __construct
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;
}
示例10: __construct
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;
}
示例11: __construct
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;
}
示例12: __construct
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;
}
示例13: __construct
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;
}
示例14: __construct
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;
}
示例15: __construct
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;
}