LMongo\Eloquent\Model::getCollection PHP 메소드

getCollection() 공개 메소드

Get the collection associated with the model.
public getCollection ( ) : string
리턴 string
    public function getCollection()
    {
        if (isset($this->collection)) {
            return $this->collection;
        }
        return str_replace('\\', '', snake_case(str_plural(get_class($this))));
    }

Usage Example

예제 #1
0
파일: Builder.php 프로젝트: navruzm/lmongo
 /**
  * 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;
 }
Model