public function getQuery($query_id = null) { $query = $this->_query; if (!$query) { $query = SalamaQuery::add($this, get_class($this)); } return $query; }
public static function __callStatic($name, $arguments) { if (!Salama::$bootstrapped) { Salama::bootstrap(); } $class = get_called_class(); $model = new $class(); $model = $model->getModelInstance($class); SalamaQuery::add($model, $class, null); if (count($arguments) == 1) { $arguments = $arguments[0]; } # @TODO wrap around SalamaQuerySet return $model->{$name}($arguments); }
public function goraw() { if (!$this->getQuery()) { $model = 'User'; SalamaQuery::add($this, $model, null); $salama = $this->getModelInstance($model); } $query = $this->getQuery(); $query->builder->prepare($query); $items = $query->database->execute($query, $this); return $this; }