Ejemplo n.º 1
0
 /**
  * Method to load and return a model object.
  *
  * @param   string  $name    The name of the view
  * @param   string  $prefix  The class prefix. Optional.
  * @param   array   $config  The configuration array to pass to the table
  *
  * @return  FOFTable  Table object or boolean false if failed
  */
 protected function &_createTable($name, $prefix = 'Table', $config = array())
 {
     // Make sure $config is an array
     if (is_object($config)) {
         $config = (array) $config;
     } elseif (!is_array($config)) {
         $config = array();
     }
     $result = null;
     // Clean the model name
     $name = preg_replace('/[^A-Z0-9_]/i', '', $name);
     $prefix = preg_replace('/[^A-Z0-9_]/i', '', $prefix);
     // Make sure we are returning a DBO object
     if (!array_key_exists('dbo', $config)) {
         $config['dbo'] = $this->getDBO();
     }
     $instance = FOFTable::getAnInstance($name, $prefix, $config);
     return $instance;
 }