コード例 #1
0
ファイル: core.php プロジェクト: rcapp/kohana-jelly
 /**
  * Constructs a new Jelly_Builder instance.
  *
  * $model is not actually allowed to be NULL. It has
  * a default because PHP throws strict errors otherwise.
  *
  * @param string $model
  */
 public function __construct($model = NULL, $type = NULL)
 {
     parent::__construct();
     if (!$model) {
         throw new Kohana_Exception(get_class($this) . ' requires $model to be set in the constructor');
     }
     // Set the model and the initial from()
     $this->_model = Jelly::model_name($model);
     $this->_register_model();
     // Default to loading as arrays
     $this->as_object(FALSE);
     // Save this for building the query later on
     $this->_type = $type;
 }