public function getCollection() { if (isset($this->collection)) { return $this->collection; } return str_replace('\\', '', snake_case(str_plural(get_class($this)))); }
/** * Set a model instance for the model being queried. * * @param \LMongo\Eloquent\Model $model * @return \LMongo\Eloquent\Builder */ public function setModel(Model $model) { $this->model = $model; $this->query->collection($model->getCollection()); return $this; }