Ejemplo n.º 1
0
 public function __construct($singular_name, $pluralize = true)
 {
     $this->_db_util = Phactory_DbUtilFactory::getDbUtil();
     $this->_singular = $singular_name;
     if ($pluralize) {
         $this->_name = Phactory_Inflector::pluralize($singular_name);
     } else {
         $this->_name = $singular_name;
     }
 }
Ejemplo n.º 2
0
 public function __construct($singular_name, $pluralize = true)
 {
     $this->_singular = $singular_name;
     if ($pluralize) {
         $this->_name = Phactory_Inflector::pluralize($singular_name);
     } else {
         $this->_name = $singular_name;
     }
     $this->_collection = Phactory::getDb()->selectCollection($this->_name);
 }
Ejemplo n.º 3
0
 public static function reset()
 {
     self::$_exceptions = array();
 }
Ejemplo n.º 4
0
 public static function setInflection($singular, $plural)
 {
     Phactory_Inflector::addException($singular, $plural);
 }
Ejemplo n.º 5
0
 /**
  * @dataProvider inflectionExceptionProvider
  */
 public function testAddException($singular, $plural)
 {
     $this->assertNotEquals(Phactory_Inflector::pluralize($singular), $plural);
     Phactory_Inflector::addException($singular, $plural);
     $this->assertEquals(Phactory_Inflector::pluralize($singular), $plural);
 }