public function findByPersistenceCode($code) { $persistence = $this->createModel()->newQuery()->where('code', $code)->first(); return $persistence ? $persistence : false; }