• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Query\Criterion类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP MVC\ConfigResolverInterface类代码示例发布时间:2022-05-23
下一篇:
PHP Content\Content类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap