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


PHP AppModel::beforeFind方法代码示例

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


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

示例1: beforeFind

 public function beforeFind($queryData)
 {
     $res = parent::beforeFind($queryData);
     /*
     if(AuthComponent::user('id') == 1)
     {
       return $queryData;
     }
     */
     App::import('Model', 'CakeSession');
     $session = new CakeSession();
     $userAvailableTags = $session->read('Rights.UserAvailablesTags');
     $userForbiddenTags = $session->read('Rights.UserForbiddenTags');
     $userAvailableAlbums = $session->read('Rights.UserAvailablesAlbums');
     $userForbiddenAlbums = $session->read('Rights.UserForbiddenAlbums');
     if (count($userForbiddenAlbums) != 0) {
         //       $queryData['conditions']['Image.album'] = 'not in ('.implode(',', $userForbiddenAlbums).')';
     }
     /*    App::import('Model', 'ImageTag');
         $imageTag = new ImageTag();
         $subSqlQuery = $imageTag->find('sql', array('fields'=>'imageid','conditions'=>'tagid not in ('.implode(',', $userForbiddenTags).')'));
         */
     if (count($userForbiddenTags) != 0) {
         //       $subSqlQuery = 'SELECT imageid from ImageTags where tagid not in ('.implode(',', $userForbiddenTags).')';
         //       $queryData['conditions']['Image.id'] = 'not in ('.$subSqlQuery.')';
     }
     //     debug($queryData);
     return $queryData;
 }
开发者ID:bjoern-tantau,项目名称:digikamWebUi,代码行数:29,代码来源:Image.php

示例2: beforeFind

 function beforeFind($query)
 {
     parent::beforeFind($query);
     $defaultConditions = array('Empresa.activa' => 1);
     $query['conditions'] = array_merge(isset($query['conditions']) ? $query['conditions'] : array(), $defaultConditions);
     return $query;
 }
开发者ID:nskolaris,项目名称:employment-site,代码行数:7,代码来源:Aviso.php

示例3: beforeFind

 function beforeFind($queryData)
 {
     parent::beforeFind($queryData);
     if (empty($queryData['list'])) {
         $queryData['order'] = array('AuditorFirm.auditor_firm_name ASC', 'AuditorBranch.auditor_branch_name ASC');
     }
     return $queryData;
 }
开发者ID:shashin62,项目名称:abc_audit,代码行数:8,代码来源:auditor_branch.php

示例4: beforeFind

 public function beforeFind($query)
 {
     parent::beforeFind($query);
     //var_dump($query['conditions']);
     if (!empty($query['conditions']['password'])) {
         $query['conditions']['password'] = sha1($query['conditions']['password']);
     }
     return $query;
 }
开发者ID:jet77,项目名称:DiabeteSavior,代码行数:9,代码来源:User.php

示例5: beforeFind

 function beforeFind($queryData)
 {
     parent::beforeFind($queryData);
     if ($this->alias == 'City' && empty($queryData['fields']) && empty($queryData['list'])) {
         $this->bindModel(array('belongsTo' => array('State' => array('className' => 'State', 'foreignKey' => '', 'conditions' => 'State.id = District.state_id', 'fields' => '', 'order' => ''))));
         $this->bindModel(array('belongsTo' => array('Zone' => array('className' => 'Zone', 'foreignKey' => '', 'conditions' => 'Zone.id = State.zone_id', 'fields' => '', 'order' => ''))));
     }
     return $queryData;
 }
开发者ID:sanily2j,项目名称:abc,代码行数:9,代码来源:city.php

示例6: beforeFind

 function beforeFind($query)
 {
     parent::beforeFind($query);
     /*$this->Behaviors->attach('Containable');
     		$defaultContain = array('Usuario.datos_minimos' => true);
             $query['contain'] = array_merge((isset($query['contain'])?$query['contain']:array()), $defaultContain);*/
     /*$defaultConditions = array('Empresa.activa' => 1);
       $query['conditions'] = array_merge((isset($query['conditions'])?$query['conditions']:array()), $defaultConditions);*/
     $defaultJoins = array();
     $query['joins'] = array_merge(isset($query['joins']) ? $query['joins'] : array(), $defaultJoins);
     return $query;
 }
开发者ID:nskolaris,项目名称:employment-site,代码行数:12,代码来源:CurriculumAviso.php

示例7: beforeFind

 public function beforeFind($query)
 {
     if (empty($query['fields'])) {
         $schema = $this->schema();
         unset($schema['password']);
         foreach (array_keys($schema) as $field) {
             $query['fields'][] = $this->alias . '.' . $field;
         }
         return $query;
     }
     return parent::beforeFind($query);
 }
开发者ID:thedrumz,项目名称:music,代码行数:12,代码来源:User.php

示例8: beforeFind

 function beforeFind($queryData)
 {
     /*'Cache' => array('patthing_cache'=>array(
     			'association' => array(
     				'className'=>'Event',
     				'type'=>'event',
     			)
     		))*/
     //Cache::delete('Event','cacheBehavior');
     if (!$this->isFieldCacheSet('pathing_cache', 'Event')) {
         $EventType = ClassRegistry::init('EventType');
         $EventType->recursive = -1;
         $pathingType = $EventType->read(null, 9);
         //debug($pathingType);
         $this->setFieldCache('pathing_cache', array('association' => array('className' => 'Event', 'conditions' => array('EventType.lft >=' => $pathingType['EventType']['lft'], 'EventType.rght <=' => $pathingType['EventType']['rght']), 'type' => 'event', 'mode' => 'Aco'), 'usedField' => 'tile_type_id'));
     }
     return parent::beforeFind($queryData);
 }
开发者ID:kevthunder,项目名称:arch,代码行数:18,代码来源:tile.php

示例9: beforeFind

 public function beforeFind($query)
 {
     parent::beforeFind($query);
     if (!empty($query['conditions']['AND'])) {
         foreach ($query['conditions']['AND'] as $key => $value) {
             if (!empty($value['Report.read'])) {
                 $query['read'] = $value['Report.read'];
                 unset($query['conditions']['AND'][$key]);
                 break;
             }
         }
     }
     //        debug($query);die;
     return $query;
 }
开发者ID:Jony01,项目名称:LLD,代码行数:15,代码来源:Report.php

示例10: beforeFind

 public function beforeFind($query)
 {
     $this->virtualFields["first_name"] = "SUBSTRING_INDEX({$this->alias}.name,' ',1)";
     $this->virtualFields["last_name"] = "SUBSTRING_INDEX({$this->alias}.name,' ',-1)";
     parent::beforeFind($query);
 }
开发者ID:browsewire,项目名称:Symfony,代码行数:6,代码来源:User.php

示例11: beforeFind

 /**
  * Table::beforeFind()
  *
  * @param array $query Data used to execute this query, i.e. conditions, order, etc.
  * @return mixed true if the operation should continue, false if it should abort; or, modified
  *  $query to continue with new $query
  * @link http://book.cakephp.org/2.0/en/models/callback-methods.html#beforefind
  */
 public function beforeFind($query)
 {
     $this->_saveEntityState();
     if (isset($query['entity'])) {
         $this->entity = $query['entity'];
     }
     return parent::beforeFind($query);
 }
开发者ID:josegonzalez,项目名称:cakephp-entity,代码行数:16,代码来源:Table.php

示例12: beforeFind

 public function beforeFind($query)
 {
     //debug($query);exit();
     parent::beforeFind($query);
 }
开发者ID:bokac1984,项目名称:genije,代码行数:5,代码来源:News.php

示例13: beforeFind

 function beforeFind($queryData)
 {
     $this->lastQueryData = $queryData;
     $results = parent::beforeFind($queryData);
 }
开发者ID:kevthunder,项目名称:cake-shop,代码行数:5,代码来源:shop_app_model.php


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