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


PHP ClassRegistry类代码示例

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


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

示例1: _findFeed

 function _findFeed(&$Model, $state, $query, $results = array())
 {
     if ($state == 'before') {
         if (!isset($query['feed'])) {
             return $query;
         }
         $DboMysql = Connectionmanager::getDataSource($Model->useDbConfig);
         $sql = '';
         foreach ((array) $query['feed'] as $key => $feed) {
             $feed = array_merge($this->basicStatement, $feed);
             $sql .= ' UNION ';
             $currentModel = ClassRegistry::init($key);
             $setup = explode(' AND ', str_replace(array('=', '`'), array('AS', '\''), $DboMysql->conditions(array_flip($feed['setup']), false, false)));
             $sql .= $DboMysql->renderStatement('select', array('fields' => implode(', ', array_merge($DboMysql->fields($currentModel, null, (array) $feed['fields']), $setup)), 'table' => $DboMysql->fullTableName($currentModel), 'alias' => $currentModel->alias, 'joins' => '', 'conditions' => $DboMysql->conditions($feed['conditions']), 'group' => '', 'order' => $DboMysql->order($feed['order']), 'limit' => $DboMysql->limit($feed['limit'])));
         }
         $query = array_merge($this->basicStatement, $query);
         $setup = explode(' AND ', str_replace(array('=', '`'), array('AS', '\''), $DboMysql->conditions(array_flip($query['setup']), false, false)));
         $sql = $DboMysql->renderStatement('select', array('fields' => implode(', ', array_merge($DboMysql->fields($Model, null, (array) $query['fields']), $setup)), 'table' => $DboMysql->fullTableName($Model), 'alias' => $Model->alias, 'joins' => '', 'conditions' => $DboMysql->conditions($query['conditions']), 'group' => $sql, 'order' => $DboMysql->order($query['order']), 'limit' => $DboMysql->limit($query['limit'])));
         $_results = $Model->query($sql);
         foreach ($_results as $res) {
             $this->_results[]['Feed'] = $res[0];
         }
         return $query;
     } elseif ($state == 'after') {
         return $this->_results;
     }
     return false;
 }
开发者ID:rchavik,项目名称:infinitas,代码行数:28,代码来源:feedable.php

示例2: setUp

 public function setUp()
 {
     parent::setUp();
     $this->DirectMessage = ClassRegistry::init('Twim.TwimDirectMessage');
     $this->DirectMessage->setDataSource('twitter');
     $this->TwimSource = $this->DirectMessage->getDataSource();
 }
开发者ID:nojimage,项目名称:cakephp-twim,代码行数:7,代码来源:TwimDirectMessageNeedAuthTest.php

示例3: tearDown

 /**
  * End a test
  *
  * @return void
  */
 public function tearDown()
 {
     parent::tearDown();
     unset($this->Article);
     ClassRegistry::flush();
     DebugKitDebugger::clearTimers();
 }
开发者ID:hupla78,项目名称:Nadia,代码行数:12,代码来源:TimedBehaviorTest.php

示例4: get_twitter_tweets_group_by_types

 public function get_twitter_tweets_group_by_types($types, $order)
 {
     foreach ($types as &$t) {
         $t = array('id' => $t, 'search' => ClassRegistry::init('Dane.Dataobject')->find('all', array('conditions' => array('dataset' => 'twitter', 'twitter_accounts.typ_id' => $t, '!bez_retweetow' => '1', 'czas_utworzenia' => '2013-*'), 'order' => $order, 'limit' => 3)));
     }
     return $types;
 }
开发者ID:slachiewicz,项目名称:_mojePanstwo-API-Server,代码行数:7,代码来源:PanstwoInternet.php

示例5: getRolesRoomsUsers

 /**
  * Return roles_rooms_users
  *
  * @param array $conditions Conditions by Model::find
  * @return array
  */
 public function getRolesRoomsUsers($conditions = array())
 {
     $this->Room = ClassRegistry::init('Rooms.Room');
     $conditions = Hash::merge(array('Room.page_id_top NOT' => null), $conditions);
     $rolesRoomsUsers = $this->find('all', array('recursive' => -1, 'fields' => array($this->alias . '.*', $this->RolesRoom->alias . '.*', $this->Room->alias . '.*'), 'joins' => array(array('table' => $this->RolesRoom->table, 'alias' => $this->RolesRoom->alias, 'type' => 'INNER', 'conditions' => array($this->alias . '.roles_room_id' . ' = ' . $this->RolesRoom->alias . ' .id')), array('table' => $this->Room->table, 'alias' => $this->Room->alias, 'type' => 'INNER', 'conditions' => array($this->RolesRoom->alias . '.room_id' . ' = ' . $this->Room->alias . ' .id'))), 'conditions' => $conditions));
     return $rolesRoomsUsers;
 }
开发者ID:Onasusweb,项目名称:Rooms,代码行数:13,代码来源:RolesRoomsUser.php

示例6: __construct

 /**
  * Constructor
  *
  */
 public function __construct()
 {
     parent::__construct();
     $this->Permission = ClassRegistry::init(array('class' => 'Permission', 'alias' => 'Permission'));
     $this->Aro = $this->Permission->Aro;
     $this->Aco = $this->Permission->Aco;
 }
开发者ID:slachiewicz,项目名称:_mojePanstwo-API-Server,代码行数:11,代码来源:DbAcl.php

示例7: beforeSave

 public function beforeSave($options = array())
 {
     $State = ClassRegistry::init('State');
     //$basketballTeam = new BasketballTeam();
     $state = $State->field('name', array('id' => $this->data['Insurance']['state_id']));
     $this->data['Insurance']['state'] = $state;
 }
开发者ID:abhinav67,项目名称:prodigy2,代码行数:7,代码来源:Insurance.php

示例8: responsePreprocess

 function responsePreprocess()
 {
     $ipn = ClassRegistry::init("PaypalIpn.InstantPaymentNotification");
     if ($ipn->isValid($_POST)) {
         $notification = $ipn->buildAssociationsFromIPN($_POST);
         $ipn->saveAll($notification);
         if ($_POST["payment_status"] == "Completed") {
             if (isset($_POST['test_ipn'])) {
                 $this->payment['ShopPayment']['dev_mode'] = 1;
                 $data = array('id' => $this->payment['ShopPayment']['id'], 'dev_mode' => $this->payment['ShopPayment']['dev_mode']);
                 $this->ShopPayment->create();
                 $this->ShopPayment->save($data);
             }
             $this->PaymentFunct->setStatus($this->payment, "approved");
         } else {
             $this->log('Incomplete payment', LOG_DEBUG);
         }
         /*$conf = Configure::read('Shop.emailAdmin');
         		$this->Email->to = $conf['to'];
         		$this->Email->subject = "test module paypal";
         		$this->Email->sendAs = 'html';
         		$this->Email->template = 'shop_test';
         		$this->set('payment', $this->payment);
         		if(!$this->Email->send()){
         			Debugger::log('response email not sent');
         		}else{
         			Debugger::log('response email sent');
         		}*/
     } else {
         $this->log('Invalide Paypal IPN response', LOG_DEBUG);
         $this->log($_POST, LOG_DEBUG);
     }
 }
开发者ID:kevthunder,项目名称:cake-shop,代码行数:33,代码来源:paypal.php

示例9: setUp

 /**
  * SetUp method
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     Configure::write('Config.language', 'deu');
     Configure::delete('Passwordable');
     Configure::write('Passwordable.auth', 'AuthTest');
     $this->User = ClassRegistry::init('Tools.ToolsUser');
     if (isset($this->User->validate['pwd'])) {
         unset($this->User->validate['pwd']);
     }
     if (isset($this->User->validate['pwd_repeat'])) {
         unset($this->User->validate['pwd_repeat']);
     }
     if (isset($this->User->validate['pwd_current'])) {
         unset($this->User->validate['pwd_current']);
     }
     if (isset($this->User->order)) {
         unset($this->User->order);
     }
     $this->User->create();
     $data = ['id' => '5', 'name' => 'admin', 'password' => Security::hash('somepwd', null, true), 'role_id' => '1'];
     $this->User->set($data);
     $result = $this->User->save();
     $this->assertTrue((bool) $result);
     Router::setRequestInfo(new CakeRequest(null, false));
 }
开发者ID:ByMyHandsOnly,项目名称:BMHO_Web,代码行数:31,代码来源:PasswordableBehaviorTest.php

示例10: __construct

 public function __construct(View $view, $settings = array())
 {
     parent::__construct($view, $settings);
     foreach ($this->uses as $model) {
         $this->{$model} = ClassRegistry::init($model);
     }
 }
开发者ID:Asdafers,项目名称:MyAL,代码行数:7,代码来源:AppHelper.php

示例11: tearDown

 /**
  * Tear Down
  * 
  * @author	Everton Yoshitani <everton@wizehive.com>
  * @since	1.0
  * @return	void 
  */
 public function tearDown()
 {
     parent::tearDown();
     unset($this->ApiBehavior);
     unset($this->Thing);
     ClassRegistry::flush();
 }
开发者ID:manzapanza,项目名称:cakephp-api-utils,代码行数:14,代码来源:ApiBehaviorTest.php

示例12: setUp

 public function setUp()
 {
     parent::setUp();
     $this->Model = ClassRegistry::init('TestImap');
     $config = [];
     $this->Imap = new TestImapSource($config);
 }
开发者ID:ByMyHandsOnly,项目名称:BMHO_Web,代码行数:7,代码来源:ImapSourceTest.php

示例13: __prepare

 /**
  * Return readable fields
  *
  * @param Model $model Model using this behavior
  * @return void
  */
 private function __prepare(Model $model)
 {
     $this->UserAttribute = ClassRegistry::init('UserAttributes.UserAttribute');
     $this->UserAttributesRole = ClassRegistry::init('UserRoles.UserAttributesRole');
     if (!isset($this->__readableFields)) {
         $results = $this->UserAttributesRole->find('list', array('recursive' => -1, 'fields' => array('user_attribute_key', 'user_attribute_key'), 'conditions' => array('role_key' => AuthComponent::user('role_key'), 'other_readable' => true)));
         $this->__readableFields = array('id');
         foreach ($results as $key => $field) {
             //Fieldのチェック
             if ($model->hasField($field)) {
                 $this->__readableFields[$key] = $model->escapeField($field);
             }
             if ($model->UsersLanguage->hasField($field)) {
                 $this->__readableFields[$key] = $model->UsersLanguage->escapeField($field);
             }
             //Field(is_xxxx_public)のチェック
             $fieldKey = sprintf(UserAttribute::PUBLIC_FIELD_FORMAT, $field);
             if ($model->hasField($fieldKey)) {
                 $this->__readableFields[$fieldKey] = $model->escapeField($fieldKey);
             }
             //Field(xxxx_file_id)のチェック
             $fieldKey = sprintf(UserAttribute::FILE_FIELD_FORMAT, $field);
             if ($model->hasField($fieldKey)) {
                 $this->__readableFields[$fieldKey] = $model->escapeField($fieldKey);
             }
         }
     }
 }
开发者ID:Onasusweb,项目名称:Users-1,代码行数:34,代码来源:UserSearchBehavior.php

示例14: startup

 /**
  * Called after the Controller::beforeFilter() and before the controller action
  *
  * @param Controller $controller Controller with components to startup
  * @return void
  * @link http://book.cakephp.org/2.0/en/controllers/components.html#Component::startup
  */
 public function startup(Controller $controller)
 {
     //RequestActionの場合、スキップする
     if (!empty($controller->request->params['requested'])) {
         return;
     }
     $this->controller = $controller;
     //Modelの呼び出し
     $this->Plugin = ClassRegistry::init('PluginManager.Plugin');
     //Pluginデータ取得
     $this->plugins = $this->Plugin->getPlugins(Plugin::PLUGIN_TYPE_FOR_CONTROL_PANEL, $this->controller->viewVars['languageId']);
     //Layoutのセット
     $this->controller->layout = 'ControlPanel.default';
     //cancelUrlをセット
     $this->controller->set('cancelUrl', '/');
     $this->controller->set('isControlPanel', true);
     $this->controller->set('hasControlPanel', true);
     //ページHelperにセット
     $this->controller->set('pluginsMenu', $this->plugins);
     if (isset($this->settings['plugin'])) {
         $plugin = $this->settings['plugin'];
     } else {
         $plugin = $this->controller->params['plugin'];
     }
     $plugin = Hash::extract($this->plugins, '{n}.Plugin[key=' . $plugin . ']');
     if (isset($plugin[0]['name']) && !isset($this->controller->viewVars['title'])) {
         $this->controller->set('title', $plugin[0]['name']);
     }
 }
开发者ID:Onasusweb,项目名称:ControlPanel,代码行数:36,代码来源:ControlPanelLayoutComponent.php

示例15: tearDown

 /**
  * tearDown method
  *
  * @return void
  */
 public function tearDown()
 {
     unset($this->Task);
     ClassRegistry::flush();
     App::build();
     parent::tearDown();
 }
开发者ID:Chromedian,项目名称:inventory,代码行数:12,代码来源:ControllerTaskTest.php


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