Ejemplo n.º 1
0
 protected function setUp()
 {
     $this->db = Zend_Db::factory('Pdo_Mysql', array('host' => '127.0.0.1', 'dbname' => 'test', 'username' => 'root', 'password' => ''));
     foreach ($this->fixtures as $table => $inserts) {
         $this->db->delete($table);
         foreach ($inserts as $insert) {
             $this->db->insert($table, $insert);
         }
     }
     Zrails_Db_Table::setRowClassPrefix('Test_Model_');
     $this->users = new Test_Model_Users($this->db);
     $this->usersPhotos = new Test_Model_Users_Photos($this->db);
     $this->categories = new Test_Model_Categories($this->db);
     $this->categoriesPhotos = new Test_Model_Categories_Photos($this->db);
 }
Ejemplo n.º 2
0
 /**
  * Get class name with prefix
  *
  * @param string $classname
  * @return string
  */
 protected function _getClassName($classname)
 {
     $prefix = Zrails_Db_Table::getRowClassPrefix();
     if (substr($classname, 0, strlen($prefix)) == $prefix) {
         return $classname;
     }
     return $prefix . $classname;
 }
Ejemplo n.º 3
0
 /**
  * Set prefix of row classes
  *
  * @param string $prefix
  * @return string
  */
 public static function setRowClassPrefix($prefix)
 {
     return self::$_rowClassPrefix = $prefix;
 }