public function findOneBySlug($slug) { $this->benchmark->query('FindOneBySlug: Player: ' . $slug); $document = parent::findOneBySlug($slug); $this->benchmark->query('FindOneBySlug: Player: ' . $slug); if (!$document) { return null; } return $document; }
public function findOneBySlug($slug) { $this->benchmark->query('FindOneBySlug: Team: ' . $slug); $document = parent::findOneBySlug($slug); $this->benchmark->query('FindOneBySlug: Team: ' . $slug); if ($document) { return $document; } $results = $this->mongo->where(array('alternateSlugs' => $slug))->get($this->collection); if ($results) { return $this->assign($results[0]); } return null; }