当前位置: 首页>>代码示例>>PHP>>正文


PHP Criterion::__construct方法代码示例

本文整理汇总了PHP中eZ\Publish\API\Repository\Values\Content\Query\Criterion::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Criterion::__construct方法的具体用法?PHP Criterion::__construct怎么用?PHP Criterion::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在eZ\Publish\API\Repository\Values\Content\Query\Criterion的用法示例。


在下文中一共展示了Criterion::__construct方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __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

示例2: __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

示例3: __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

示例4: __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

示例5: __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

示例6: __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

示例7: __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

示例8: __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

示例9: __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

示例10: __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

示例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::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。