model = $model; if (is_string($model)) { $this->model = Snowflake::createObject($model); } $this->query = $query; parent::__construct($array, $flags); } /** * @param $current * @return ActiveRecord */ protected function newModel($current) { return (clone $this->model)->setAttributes($current); } /** * @return ActiveRecord|mixed */ public function current() { $current = parent::current(); if (!($current instanceof ActiveRecord)) { $current = $this->newModel($current); } return $this->query->getWith($current); } }