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


PHP Repository::find方法代码示例

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


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

示例1: extract

 /**
  * Removes an object relation from the aggregation.
  * 
  * @see KObjectSet::extract()
  */
 public function extract($target)
 {
     $relation = $this->_child->find(array($this->_property => $this->_root, $this->_target_property => $target));
     if ($relation) {
         $relation->delete();
     }
     return $relation;
 }
开发者ID:stonyyi,项目名称:anahita,代码行数:13,代码来源:manytomany.php

示例2: find

 /**
  * @return Permission[]
  */
 public function find()
 {
     $result = parent::find();
     $permissions = array();
     foreach ($result as $row) {
         $permissions[] = new Permission($row);
     }
     return $permissions;
 }
开发者ID:arkuuu,项目名称:publin,代码行数:12,代码来源:PermissionRepository.php

示例3: find

 /**
  * @return Author[]
  */
 public function find()
 {
     $result = parent::find();
     $authors = array();
     foreach ($result as $row) {
         $authors[] = new Author($row);
     }
     return $authors;
 }
开发者ID:arkuuu,项目名称:publin,代码行数:12,代码来源:AuthorRepository.php

示例4: find

 /**
  * @return Keyword[]
  */
 public function find()
 {
     $result = parent::find();
     $keywords = array();
     foreach ($result as $row) {
         $keywords[] = new Keyword($row);
     }
     return $keywords;
 }
开发者ID:arkuuu,项目名称:publin,代码行数:12,代码来源:KeywordRepository.php

示例5: find

 /**
  * @return File[]
  */
 public function find()
 {
     $result = parent::find();
     $files = array();
     foreach ($result as $row) {
         $files[] = new File($row);
     }
     return $files;
 }
开发者ID:arkuuu,项目名称:publin,代码行数:12,代码来源:FileRepository.php

示例6: find

 /**
  * @return Url[]
  */
 public function find()
 {
     $result = parent::find();
     $urls = array();
     foreach ($result as $row) {
         $urls[] = new Url($row);
     }
     return $urls;
 }
开发者ID:arkuuu,项目名称:publin,代码行数:12,代码来源:UrlRepository.php

示例7: find

 /**
  * @return Type[]
  */
 public function find()
 {
     $result = parent::find();
     $types = array();
     foreach ($result as $row) {
         $types[] = new Type($row);
     }
     return $types;
 }
开发者ID:arkuuu,项目名称:publin,代码行数:12,代码来源:TypeRepository.php

示例8: users

 function users($id = null)
 {
     if (is_null($id)) {
         $this->e404();
     }
     $this->paginate['Expert']['conditions'] = array('Expert.repository_id' => $id);
     $this->data = $this->paginate('Expert');
     $repo = $this->Repository->find('first', array('conditions' => compact('id'), 'recursive' => -1));
     $data = array('current' => 'repositories', 'repo' => $repo, 'menu' => 'menu_admin', 'title' => "Collaborators of '{$repo['Repository']['name']}' Repository", 'cond' => 'owner', 'footnotes' => array('Repository owner (only 1)'));
     $this->set($data);
     $this->render('../admin_usuarios/listar');
 }
开发者ID:rmeruane,项目名称:repositorium,代码行数:12,代码来源:admin_repositories_controller.php

示例9: find

 /**
  * @return Citation[]
  */
 public function find()
 {
     $result = parent::find();
     $citations = array();
     foreach ($result as $row) {
         $citation = new Citation($row);
         $repo = new PublicationRepository($this->db);
         $citation->setCitationPublication($repo->where('id', '=', $citation->getCitationId())->findSingle());
         $citations[] = $citation;
     }
     return $citations;
 }
开发者ID:arkuuu,项目名称:publin,代码行数:15,代码来源:CitationRepository.php

示例10: find

 /**
  * @param bool $full
  *
  * @return Role[]
  */
 public function find($full = false)
 {
     $result = parent::find();
     $roles = array();
     foreach ($result as $row) {
         $role = new Role($row);
         if ($full === true) {
             $repo = new PermissionRepository($this->db);
             $role->setPermissions($repo->where('role_id', '=', $role->getId())->order('name', 'ASC')->find());
         }
         $roles[] = $role;
     }
     return $roles;
 }
开发者ID:arkuuu,项目名称:publin,代码行数:19,代码来源:RoleRepository.php

示例11: find

 /**
  * @param bool $full
  *
  * @return User[]
  */
 public function find($full = false)
 {
     $result = parent::find();
     $users = array();
     foreach ($result as $row) {
         $user = new User($row);
         if ($full === true) {
             $repo = new RoleRepository($this->db);
             $user->setRoles($repo->where('user_id', '=', $user->getId())->order('name', 'ASC')->find());
             $repo = new PermissionRepository($this->db);
             $user->setPermissions($repo->where('user_id', '=', $user->getId())->order('name', 'ASC')->find());
         }
         $users[] = $user;
     }
     return $users;
 }
开发者ID:arkuuu,项目名称:publin,代码行数:21,代码来源:UserRepository.php

示例12: array

 /**
  * 
  * set repository data in session, by id or url, if exists
  * @param array $data
  * @return array array( boolean: status, array: data | null)
  */
 function _set_repo($data = array())
 {
     if (empty($data)) {
         return array(false, null);
     }
     if (isset($data['repo_url'])) {
         $repo = $this->Repository->find('first', array('conditions' => array('Repository.url' => $data['repo_url']), 'recursive' => -1));
     } elseif (isset($data['repo_id'])) {
         $repo = $this->Repository->find('first', array('conditions' => array('Repository.id' => $data['repo_id']), 'recursive' => -1));
     }
     if (!empty($repo)) {
         $this->setRepositorySession($repo);
         return array(true, $repo);
     } else {
         return array(false, null);
     }
 }
开发者ID:rmeruane,项目名称:repositorium,代码行数:23,代码来源:repositories_controller.php

示例13: find

 /**
  * @param bool $full
  *
  * @return Publication[]
  */
 public function find($full = false)
 {
     $result = parent::find();
     $publications = array();
     foreach ($result as $row) {
         $publication = new Publication($row);
         $repo = new AuthorRepository($this->db);
         $publication->setAuthors($repo->where('publication_id', '=', $publication->getId())->order('priority', 'ASC')->find());
         $repo = new FileRepository($this->db);
         $publication->setFiles($repo->where('publication_id', '=', $publication->getId())->find());
         $repo = new UrlRepository($this->db);
         $publication->setUrls($repo->where('publication_id', '=', $publication->getId())->find());
         if ($full === true) {
             $repo = new KeywordRepository($this->db);
             $publication->setKeywords($repo->where('publication_id', '=', $publication->getId())->order('name', 'ASC')->find());
         }
         $publications[] = $publication;
     }
     return $publications;
 }
开发者ID:arkuuu,项目名称:publin,代码行数:25,代码来源:PublicationRepository.php

示例14: getCurrentRepository

 /**
  * returns current repository data as array 
  * note: if host is localhost, it just reads from the session var
  * which means to have an expiration time
  */
 function getCurrentRepository()
 {
     $repo = null;
     if (Configure::read('App.subdomains')) {
         $url = explode('.', $_SERVER['HTTP_HOST'], 3);
         if (count($url) === 2 or $url[0] === 'www') {
             $repo = null;
         } else {
             $repo = $url[0];
         }
     } elseif ($this->Session->check('Repository.current')) {
         $repo = $this->Session->read('Repository.current');
     }
     if (!is_null($repo)) {
         $data = $this->Repository->find('first', array('conditions' => array('Repository.url' => $repo)));
         if (!is_null($data) && !empty($data)) {
             return $data;
         }
     }
     return null;
 }
开发者ID:rmeruane,项目名称:repositorium,代码行数:26,代码来源:app_controller.php

示例15: testAutoEagerLoading

 public function testAutoEagerLoading()
 {
     $person = new Person();
     // We expect a new person to contain the
     // relations defined with the ResourceInterface 'unit'.
     $person = $this->repository->create($person);
     $this->assertEquals(0, $person->roles->count());
     $this->assertEquals(0, $person->children->count());
     // Check auto-eager-loading.
     $homer = $this->repository->find(1);
     $this->assertEquals(1, $homer->roles->count());
     $this->assertEquals(3, $homer->children->count());
     $simpsons = $this->repository->all();
     $simpsons = json_decode(json_encode($simpsons));
     $this->assertEquals(1, count($simpsons[0]->roles));
     $this->assertFalse(property_exists($simpsons[0], 'children'));
     // Check that repository with() method override default settings.
     $simpsons = $this->repository->with(['roles', 'children'])->all();
     $simpsons = json_decode(json_encode($simpsons));
     $this->assertEquals(1, count($simpsons[0]->roles));
     $this->assertEquals(3, count($simpsons[0]->children));
 }
开发者ID:foothing,项目名称:laravel-repository,代码行数:22,代码来源:EloquentRepositoryTest.php


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