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


PHP Q::neq方法代码示例

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


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

示例1: index

 /**
  * トップページ
  *
  * @context integer $package_count パッケージ総数
  * @context $primary_tags primary がセットされているタグリスト(上限付き)
  * @context $recent_releases 最新 OpenpearRelease モデルの配列
  */
 public function index()
 {
     if (Store::has('index/package_count', 3600)) {
         $package_count = Store::get('index/package_count');
     } else {
         $package_count = C(OpenpearPackage)->find_count();
         Store::set('index/package_count', $package_count, 3600);
     }
     if (Store::has('index/primary_tags', 3600)) {
         $primary_tags = Store::get('index/primary_tags');
     } else {
         $primary_tags = OpenpearPackage::getActiveCategories(8);
         Store::set('index/primary_tags', $primary_tags, 3600);
     }
     if (Store::has('index/recent_releases', 3600)) {
         $recent_releases = Store::get('index/recent_releases');
     } else {
         $recent_releases = C(OpenpearPackage)->find_all(new Paginator(5), Q::neq('latest_release_id', null), Q::order('-released_at'));
         Store::set('index/recent_releases', $recent_releases, 3600);
     }
     if (Store::has('index/most_downloaded', 3600)) {
         $most_downloaded = Store::get('index/most_downloaded');
     } else {
         $most_downloaded = C(OpenpearPackage)->find_all(new Paginator(5), Q::order('-download_count'));
         Store::set('index/most_downloaded', $most_downloaded, 3600);
     }
     $this->vars('package_count', $package_count);
     $this->vars('primary_tags', $primary_tags);
     $this->vars('recent_releases', $recent_releases);
     $this->vars('most_downloaded', $most_downloaded);
 }
开发者ID:nequal,项目名称:Openpear,代码行数:38,代码来源:OpenpearNoLogin.php

示例2: after_delete

 public function after_delete()
 {
     $this->_reset_primaries();
     $this->_recount_tags();
     if (C(OpenpearPackageTag)->find_count(Q::neq('package_id', $this->package_id()), Q::eq('tag_id', $this->tag_id())) === 0) {
         $tag = $this->tag();
         $tag->delete();
     }
 }
开发者ID:nequal,项目名称:Openpear,代码行数:9,代码来源:OpenpearPackageTag.php

示例3: validate

 /**
  * 値の妥当性チェックを行う
  */
 public function validate()
 {
     foreach ($this->columns(true) as $name => $column) {
         if (!\ebi\Exceptions::has($name)) {
             $value = $this->{$name}();
             \ebi\Validator::value($name, $value, ['type' => $this->prop_anon($name, 'type'), 'min' => $this->prop_anon($name, 'min'), 'max' => $this->prop_anon($name, 'max'), 'require' => $this->prop_anon($name, 'require')]);
             $unique_together = $this->prop_anon($name, 'unique_together');
             if ($value !== '' && $value !== null && ($this->prop_anon($name, 'unique') === true || !empty($unique_together))) {
                 $uvalue = $value;
                 $q = [\ebi\Q::eq($name, $uvalue)];
                 if (!empty($unique_together)) {
                     foreach (is_array($unique_together) ? $unique_together : [$unique_together] as $c) {
                         $q[] = Q::eq($c, $this->{$c}());
                     }
                 }
                 foreach ($this->primary_columns() as $primary) {
                     if (null !== $this->{$primary->name()}) {
                         $q[] = Q::neq($primary->name(), $this->{$primary->name()});
                     }
                 }
                 if (0 < call_user_func_array([get_class($this), 'find_count'], $q)) {
                     \ebi\Exceptions::add(new \ebi\exception\UniqueException($name . ' unique'), $name);
                 }
             }
             $master = $this->prop_anon($name, 'master');
             if (!empty($master)) {
                 $master = str_replace('.', "\\", $master);
                 if ($master[0] !== '\\') {
                     $master = '\\' . $master;
                 }
                 try {
                     $r = new \ReflectionClass($master);
                 } catch (\ReflectionException $e) {
                     $self = new \ReflectionClass(get_class($this));
                     $r = new \ReflectionClass("\\" . $self->getNamespaceName() . $master);
                 }
                 $mo = $r->newInstanceArgs();
                 $primarys = $mo->primary_columns();
                 if (empty($primarys) || 0 === call_user_func_array([$mo, 'find_count'], [Q::eq(key($primarys), $this->{$name})])) {
                     \ebi\Exceptions::add(new \ebi\exception\NotFoundException($name . ' master not found'), $name);
                 }
             }
             try {
                 if (method_exists($this, '__verify_' . $column->name() . '__') && call_user_func([$this, '__verify_' . $column->name() . '__']) === false) {
                     \ebi\Exceptions::add(new \ebi\exception\VerifyException($column->name() . ' verification failed'), $column->name());
                 }
             } catch (\ebi\Exceptions $e) {
             } catch (\Exception $e) {
                 \ebi\Exceptions::add($e, $column->name());
             }
         }
     }
     \ebi\Exceptions::throw_over();
 }
开发者ID:tokushima,项目名称:ebi,代码行数:57,代码来源:Dao.php

示例4: save_verify

 private final function save_verify()
 {
     foreach ($this->self_columns() as $name => $column) {
         $type = $this->a($name, "type");
         $value = $this->{$name};
         if ($this->a($name, "require") === true && ($value === "" || $value === null)) {
             Exceptions::add(new Exception($name . " required"));
         }
         if ($this->a($name, "unique") === true) {
             $q = array(Q::eq($name, $value));
             foreach ($this->primary_columns() as $column) {
                 if (null !== ($value = $this->{$column->name()}())) {
                     $q[] = Q::neq($column->name(), $this->{$column->name()}());
                 }
             }
             if (0 < call_user_func_array(array(C($this), "find_count"), $q)) {
                 Exceptions::add(new Exception($name . " unique"));
             }
         }
     }
     foreach ($this->self_columns() as $column) {
         if (!$this->{"is" . ucfirst($column->name())}()) {
             Exceptions::add(new Exception("verify fail"));
         }
     }
     $this->__save_verify__();
     Exceptions::validation();
 }
开发者ID:hisaboh,项目名称:w2t,代码行数:28,代码来源:Dao.php

示例5: where_match

 protected function where_match(Q $q, array $self_columns)
 {
     $query = new Q();
     foreach ($q->arArg1() as $cond) {
         if (strpos($cond, "=") !== false) {
             list($column, $value) = explode("=", $cond);
             $not = substr($value, 0, 1) == "!";
             $value = $not ? strlen($value) > 1 ? substr($value, 1) : "" : $value;
             if ($value === "") {
                 $query->add($not ? Q::neq($column, "") : Q::eq($column, ""));
             } else {
                 $query->add($not ? Q::contains($column, $value, $q->param() | Q::NOT) : Q::contains($column, $value, $q->param()));
             }
         } else {
             $columns = array();
             foreach ($self_columns as $column) {
                 $columns[] = $column->name();
             }
             $query->add(Q::contains(implode(",", $columns), explode(" ", $cond), $q->param()));
         }
     }
     return $query;
 }
开发者ID:hisaboh,项目名称:w2t,代码行数:23,代码来源:DbController.php


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