Exemple #1
0
 /**
  * This constructor instantiates this class using the specified model's name.
  *
  * @access public
  * @param string $model                             the model's name
  */
 public function __construct($model)
 {
     $name = $model;
     $model = DB_ORM_Model::model_name($name);
     $this->data_source = DB_DataSource::instance($model::data_source(DB_DataSource::MASTER_INSTANCE));
     $builder = 'DB_' . $this->data_source->dialect . '_Update_Builder';
     $this->builder = new $builder($this->data_source);
     $extension = DB_ORM_Model::builder_name($name);
     if (class_exists($extension)) {
         $this->extension = new $extension($this->builder);
     }
     $table = $model::table();
     $this->builder->table($table);
 }
Exemple #2
0
 /**
  * This function sets which table will be modified.
  *
  * @access public
  * @param string $table                         the database table to be modified
  * @param string $alias                         the alias to be used for the specified table
  * @return DB_SQL_Update_Proxy                  a reference to the current instance
  */
 public function table($table, $alias = NULL)
 {
     $this->builder->table($table, $alias);
     return $this;
 }