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


PHP Ak::pick方法代码示例

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


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

示例1: _addOrEditRole

 function _addOrEditRole($action)
 {
     $this->role->setAttributes(Ak::pick('name,description,is_enabled', $this->params['role']));
     if ($this->role->save()){
         $this->flash_options = array('seconds_to_close' => 10);
         $this->flash['notice'] = $this->t('Role was successfully '.($action=='add'?'created':'updated'.'.'));
         $this->redirectToAction('listing');
     }
 }
开发者ID:joeymetal,项目名称:v1,代码行数:9,代码来源:roles_controller.php

示例2: test_should_find_using_named_bindings

 public function test_should_find_using_named_bindings()
 {
     $this->installAndIncludeModels(array('Hybrid' => 'id,customer_id,input,parent_id'));
     $Hybrid = new Hybrid();
     $customer_id = 12;
     $input = 'abc';
     $parent_id = 123;
     $Hybrid->create(array('customer_id' => $customer_id, 'input' => $input, 'parent_id' => $parent_id));
     $results = $Hybrid->find('all', array('conditions' => array('customer_id = :customer_id AND input = :input AND parent_id = :parent_id', ':customer_id' => $customer_id, ':input' => $input, ':parent_id' => $parent_id)));
     $this->assertEqual(Ak::pick('customer_id,input,parent_id', $results[0]->getAttributes()), array('customer_id' => $customer_id, 'input' => $input, 'parent_id' => $parent_id));
 }
开发者ID:bermi,项目名称:akelos,代码行数:11,代码来源:finders.php

示例3: test_should_set_and_get_attributes

 public function test_should_set_and_get_attributes()
 {
     $this->WebPage->title = 'Akelos.org';
     $this->WebPage->body = 'Akelos PHP framework...';
     $this->WebPage->keywords = array('one', 'two');
     $this->assertNull($this->WebPage->getId());
     $this->assertTrue($this->WebPage->isNewRecord());
     $this->WebPage->save();
     $this->assertFalse($this->WebPage->isNewRecord());
     $this->assertEqual($this->WebPage->title, 'Akelos.org');
     $this->assertEqual(Ak::pick('body', $this->WebPage->getAttributes()), array('body' => 'Akelos PHP framework...'));
     $this->assertEqual($this->WebPage->getAttribute('body'), 'Akelos PHP framework...');
     $this->assertNotNull($this->WebPage->getId());
 }
开发者ID:bermi,项目名称:akelos,代码行数:14,代码来源:crud.php

示例4: mapHasManyAssociations

 private function mapHasManyAssociations($Resource, $associations, $options)
 {
     if (is_array($associations)) {
         foreach ($associations as $k => $v) {
             if (is_int($k)) {
                 $this->mapHasManyAssociations($Resource, $v, $options);
             } else {
                 $this->mapHasManyAssociations($Resource, $k, array_merge($options, array('has_many' => $v)));
             }
         }
     } else {
         $options = array_merge(array('path_prefix' => $Resource->getNestingPathPrefix(), 'name_prefix' => $Resource->getNestingNamePrefix(), 'has_many' => isset($options['has_many']) ? $options['has_many'] : null), Ak::pick($this->_inheritable_options, $options));
         $this->resources($associations, $options);
     }
 }
开发者ID:bermi,项目名称:akelos,代码行数:15,代码来源:resources.php

示例5: test_should_pick_parameters

 public function test_should_pick_parameters()
 {
     $params = array('id' => 3, 'is_enabled' => 1, 'name' => 'Alicia');
     $this->assertEqual(Ak::pick('id,name', $params), array('id' => 3, 'name' => 'Alicia'));
 }
开发者ID:joeymetal,项目名称:v1,代码行数:5,代码来源:_Ak_support_functions.php


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