Development

/branches/1.3/lib/plugins/sfDoctrinePlugin/lib/database/sfDoctrineDataRetriever.class.php

You must first sign up to be able to contribute.

root/branches/1.3/lib/plugins/sfDoctrinePlugin/lib/database/sfDoctrineDataRetriever.class.php

Revision 23810, 1.1 kB (checked in by Kris.Wallsmith, 4 years ago)

[1.3] set svn:eol-style property to native and svn:keywords property to Id on all .php files

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
Line 
1 <?php
2
3 /*
4  * This file is part of the symfony package.
5  * (c) Fabien Potencier <fabien.potencier@symfony-project.com>
6  * (c) Jonathan H. Wage <jonwage@gmail.com>
7  *
8  * For the full copyright and license information, please view the LICENSE
9  * file that was distributed with this source code.
10  */
11
12 /**
13  * Doctrine data retriever. Used to assist helpers with retrieving data for
14  * selector options.
15  *
16  * @package    symfony
17  * @subpackage doctrine
18  * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
19  * @author     Jonathan H. Wage <jonwage@gmail.com>
20  * @version    SVN: $Id$
21  */
22 class sfDoctrineDataRetriever
23 {
24   /**
25    * Used internally by symfony for retrieving objects for selector helper options.
26    *
27    * @param string $model       Name of the model to retrieve the objects from.
28    * @param string $peerMethod  Name of the peer method to invoke on the Doctrine_Table instance for the model.
29    */
30   static public function retrieveObjects($class, $peerMethod = 'findAll')
31   {
32     if (!$peerMethod)
33     {
34       $peerMethod = 'findAll';
35     }
36
37     $table = Doctrine_Core::getTable($class);
38
39     return call_user_func(array($table, $peerMethod));
40   }
41 }
Note: See TracBrowser for help on using the browser.