當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Query\Criterion類代碼示例

本文整理匯總了PHP中eZ\Publish\API\Repository\Values\Content\Query\Criterion的典型用法代碼示例。如果您正苦於以下問題:PHP Criterion類的具體用法?PHP Criterion怎麽用?PHP Criterion使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Criterion類的13個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 /**
  * Creates a new TagKeyword criterion.
  *
  * @param string $operator
  * @param string|string[] $value One or more tag keywords that must be matched
  * @param string $target Field definition identifier to use
  * @param \eZ\Publish\API\Repository\Values\Content\Query\Criterion\Value $valueData
  *
  * @throws \InvalidArgumentException if a non string parameter is given
  * @throws \InvalidArgumentException if the value type doesn't match the operator
  */
 public function __construct($operator, $value, $target = null, Value $valueData = null)
 {
     parent::__construct($target, $operator, $value, $valueData);
 }
開發者ID:umanit,項目名稱:TagsBundle,代碼行數:15,代碼來源:TagKeyword.php

示例2: __construct

 /**
  * Creates a new Visibility criterion.
  *
  * @param int $value Visibility: self::VISIBLE, self::HIDDEN
  *
  * @throws \InvalidArgumentException
  */
 public function __construct($value)
 {
     if ($value !== self::VISIBLE && $value !== self::HIDDEN) {
         throw new InvalidArgumentException("Invalid visibility value {$value}");
     }
     parent::__construct(null, null, $value);
 }
開發者ID:Pixy,項目名稱:ezpublish-kernel,代碼行數:14,代碼來源:Visibility.php

示例3: __construct

 /**
  * Creates a new DateMetadata criterion on $metadata
  *
  * @throws \InvalidArgumentException If target is unknown
  *
  * @param string $target One of DateMetadata::CREATED or DateMetadata::MODIFIED
  * @param string $operator One of the Operator constants
  * @param mixed $value The match value, either as an array of as a single value, depending on the operator
  */
 public function __construct($target, $operator, $value)
 {
     if ($target != self::MODIFIED && $target != self::CREATED) {
         throw new InvalidArgumentException("Unknown DateMetadata {$target}");
     }
     parent::__construct($target, $operator, $value);
 }
開發者ID:dfritschy,項目名稱:ezpublish-kernel,代碼行數:16,代碼來源:DateMetadata.php

示例4: __construct

 /**
  * Creates a new LanguageCode criterion.
  *
  * @param string|string[] $value One or more language codes that must be matched
  * @param bool $matchAlwaysAvailable Denotes if always-available Content is to be matched regardless
  *                                      of language codes, this is the default behaviour
  *
  * @throws \InvalidArgumentException if non string value is given
  * @throws \InvalidArgumentException if the value type doesn't match the operator
  */
 public function __construct($value, $matchAlwaysAvailable = true)
 {
     if (!is_bool($matchAlwaysAvailable)) {
         throw new InvalidArgumentType('matchAlwaysAvailable', 'boolean', $matchAlwaysAvailable);
     }
     $this->matchAlwaysAvailable = $matchAlwaysAvailable;
     parent::__construct(null, null, $value);
 }
開發者ID:Pixy,項目名稱:ezpublish-kernel,代碼行數:18,代碼來源:LanguageCode.php

示例5: __construct

 /**
  * Creates a new SubTree criterion.
  *
  * @param string|string[] $value an array of subtree path strings, eg: /1/2/
  *
  * @throws InvalidArgumentException if a non path string is given
  * @throws InvalidArgumentException if the value type doesn't match the operator
  */
 public function __construct($value)
 {
     foreach ((array) $value as $pathString) {
         if (preg_match('/^(\\/\\w+)+\\/$/', $pathString) !== 1) {
             throw new InvalidArgumentException("value '{$pathString}' must follow the pathString format, eg /1/2/");
         }
     }
     parent::__construct(null, null, $value);
 }
開發者ID:zerustech,項目名稱:ezpublish-kernel,代碼行數:17,代碼來源:PermissionSubtree.php

示例6: __construct

 /**
  * Creates a new UserMetadata criterion on $metadata.
  *
  * @throws \InvalidArgumentException If target is unknown
  *
  * @param string $target One of UserMetadata::OWNER, UserMetadata::GROUP or UserMetadata::MODIFIED
  * @param string $operator One of the Operator constants
  * @param mixed $value The match value, either as an array of as a single value, depending on the operator
  */
 public function __construct($target, $operator, $value)
 {
     switch ($target) {
         case self::OWNER:
         case self::GROUP:
         case self::MODIFIER:
             parent::__construct($target, $operator, $value);
             return;
     }
     throw new InvalidArgumentException("Unknown UserMetadata {$target}");
 }
開發者ID:ezsystems,項目名稱:ezpublish-api,代碼行數:20,代碼來源:UserMetadata.php

示例7: __construct

 public function __construct($value, array $properties = array())
 {
     parent::__construct(null, Operator::LIKE, $value);
     // Assign additional properties, ugly but with the existing constructor
     // API the only sensible way, I guess.
     foreach ($properties as $name => $value) {
         if (!isset($this->{$name})) {
             throw new \InvalidArgumentException("Unknown property {$name}.");
         }
         $this->{$name} = $value;
     }
 }
開發者ID:ezsystems,項目名稱:ezpublish-api,代碼行數:12,代碼來源:FullText.php

示例8: __construct

 /**
  * Creates a new Status criterion
  *
  * @param string|string[] $value Status: self::STATUS_ARCHIVED, self::STATUS_DRAFT, self::STATUS_PUBLISHED
  *
  * @throws \InvalidArgumentException
  */
 public function __construct($value)
 {
     foreach ((array) $value as $statusValue) {
         switch ($statusValue) {
             case self::STATUS_ARCHIVED:
             case self::STATUS_DRAFT:
             case self::STATUS_PUBLISHED:
                 continue;
             default:
                 throw new InvalidArgumentException("Invalid status {$statusValue}");
         }
     }
     parent::__construct(null, null, $value);
 }
開發者ID:brookinsconsulting,項目名稱:ezecosystem,代碼行數:21,代碼來源:Status.php

示例9: __construct

 /**
  * Creates a new remoteId criterion.
  *
  * @param int|int[] $value One or more remoteId that must be matched
  *
  * @throws \InvalidArgumentException if a non numeric id is given
  * @throws \InvalidArgumentException if the value type doesn't match the operator
  */
 public function __construct($value)
 {
     parent::__construct(null, null, $value);
 }
開發者ID:ezsystems,項目名稱:ezpublish-api,代碼行數:12,代碼來源:RemoteId.php

示例10: __construct

 /**
  * Creates a new more like this criterion.
  *
  * @param int $type the type (one of CONTENT,TEXT,URL)
  * @param mixed $value the value depending on the type
  *
  * @throws \InvalidArgumentException if the value type doesn't match the expected type
  */
 public function __construct($type, $value)
 {
     $this->type = $type;
     parent::__construct(null, null, $value);
 }
開發者ID:ezsystems,項目名稱:ezpublish-api,代碼行數:13,代碼來源:MoreLikeThis.php

示例11: __construct

 /**
  * Creates a new LocationPriority criterion
  *
  * @param string $operator One of the Operator constants
  * @param mixed $value The match value, either as an array of as a single value, depending on the operator
  *
  * @deprecated Since 5.3, use Location search instead
  */
 public function __construct($operator, $value)
 {
     parent::__construct(null, $operator, $value);
 }
開發者ID:CG77,項目名稱:ezpublish-kernel,代碼行數:12,代碼來源:LocationPriority.php

示例12: __construct

 /**
  * @param string $target FieldDefinition identifier
  * @param string $operator One of the supported Operator constants
  * @param float|float[] $distance The match value in kilometers, either as an array
  *                                or as a single value, depending on the operator
  * @param float $latitude Latitude of the location that distance is calculated from
  * @param float $longitude Longitude of the location that distance is calculated from
  */
 public function __construct($target, $operator, $distance, $latitude, $longitude)
 {
     $distanceStart = new MapLocationValue($latitude, $longitude);
     parent::__construct($target, $operator, $distance, $distanceStart);
 }
開發者ID:dfritschy,項目名稱:ezpublish-kernel,代碼行數:13,代碼來源:MapLocationDistance.php

示例13: __construct

 /**
  * Creates a new TagId criterion.
  *
  * @param int|int[] $value One or more tag IDs that must be matched
  * @param string $target Field definition identifier to use
  *
  * @throws \InvalidArgumentException if a non numeric id is given
  * @throws \InvalidArgumentException if the value type doesn't match the operator
  */
 public function __construct($value, $target = null)
 {
     parent::__construct($target, null, $value);
 }
開發者ID:umanit,項目名稱:TagsBundle,代碼行數:13,代碼來源:TagId.php


注:本文中的eZ\Publish\API\Repository\Values\Content\Query\Criterion類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。