Development

/branches/1.0/lib/addon/propel/database/sfPropelDataRetriever.class.php

You must first sign up to be able to contribute.

root/branches/1.0/lib/addon/propel/database/sfPropelDataRetriever.class.php

Revision 3493, 1.1 kB (checked in by fabien, 7 years ago)

removed the DATABASE_NAME constants (closes #1433 - patch from chtito)

  • Property svn:mime-type set to text/x-php
  • 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) 2004-2006 Fabien Potencier <fabien.potencier@symfony-project.com>
6  *
7  * For the full copyright and license information, please view the LICENSE
8  * file that was distributed with this source code.
9  */
10
11 /**
12  * sfGenerator is the abstract base class for all generators.
13  *
14  * @package    symfony
15  * @subpackage database
16  * @author     Olivier Verdier <Olivier.Verdier@gmail.com>
17  * @version    SVN: $Id $
18  */
19 class sfPropelDataRetriever
20 {
21   static public function retrieveObjects($class, $peerMethod = null)
22   {
23     if (!$classPath = sfCore::getClassPath($class.'Peer'))
24     {
25       throw new sfException(sprintf('Unable to find path for class "%s".', $class.'Peer'));
26     }
27
28     require_once($classPath);
29
30     if (!$peerMethod)
31     {
32       $peerMethod = 'doSelect';
33     }
34
35     $classPeer = $class.'Peer';
36
37     if (!is_callable(array($classPeer, $peerMethod)))
38     {
39       throw new sfException(sprintf('Peer method "%s" not found for class "%s"', $peerMethod, $classPeer));
40     }
41
42     $objects = call_user_func(array($classPeer, $peerMethod), new Criteria());
43
44     return $objects;
45   }
46 }
Note: See TracBrowser for help on using the browser.