Get last period by organization and by fiscal year

@param  int $id Organization id

@return Illuminate\Database\Eloquent\Collection
181446
public function lastPeriodbyOrganizationAndByFiscalYear($organizationId, $fiscalYearId)
  {
    $Period = $this->Period->selectRaw('id, end_date, max(month) as month')
      ->where('organization_id', '=', $organizationId)
      ->where('fiscal_year_id', '=', $fiscalYearId)
      ->orderBy('month', 'desc')
      ->groupBy(array('id', 'end_date'))
      ->first();

    return $Period;
  }
1043576
public function get($id) {
        $this->checkPermissions('get');
        
        return $this->client->retrieveData($this->resourceName . '/' . $id);
    }
272337
public function getParentAll($id): Collection
    {
        $ids = $this->repo->find($id, ['path'])->toArray();

        return $this->repo->pushCriteria(new GetParentAll($ids))
            ->all();
    }
731269
public function get(int $id): Agenda
    {
        return $this->getClient()->call(null, $id, self::ENDPOINT, Agenda::class, false, 'GET');
    }
179791
public function getAncestry($id)
    {
        $all_results = new Collection(DB::select($this->getAncestryInitialQuery(), [':id' => $id]));

        if (count($all_results)) {
            $this->getRecursiveAncestry($all_results, $all_results->lists('parent_id'));
        }

        return $all_results;
    }
468884
public function getCalculation($id)
    {
        if ($this->calculations === null) {
            $this->execute();
        }

        return isset($this->calculations[$id]) ? $this->calculations[$id] : null;
    }
455047
public function get($id)
    {
        $entry = $this->readFile($id);
        if ($entry != false && $this->isTtlMode()) {
            $entry = (is_null($entry[static::ENTRY_EXPIRATION]) || $entry[static::ENTRY_EXPIRATION] > $this->getTime())
                ? $entry[static::ENTRY_VALUE]
                : false
            ;
        }
        return $entry;
    }
30784
final protected function getCollection($id, $default = null)
    {
        if ($id instanceof CollectionInterface) {
            return $id;
        }

        if (is_numeric($id)) {
            return $this->collectionManager->find($id);
        }

        if ($default instanceof CollectionInterface) {
            return $default;
        }

        return null;
    }
1059425
public function findOrFail($id)
    {
        if ($this->refresh) {
            $this->forget($id);
        }
        return $this->cache->remember($this->keyPrefix . $id, $this->minutesToCache, function () use ($id) {
            return $this->decorated->findOrFail($id);
        });
    }
357579
function getCategory($id){
        if(is_numeric($id))
            $model=self::where('id',$id)->select();
        else
            $model=self::where('slug',$id)->select();

        $model->where('model_type',$this->modelType);

        return $model->first();
    }
684281
public static function getCountyName($id){
        if(is_numeric($id) && array_key_exists(intval($id), self::$counties)){
            return self::$counties[intval($id)];
        }
        return false;
    }
856973
public function get($id)
    {
        return $this->getByPath(sprintf('/%s/%s/%s', MoipResource::VERSION, self::PATH, $id));
    }
169236
public function getMany(array $id) {
		$preparedIds = array_map([$this, 'prepareId'], $id);
		
		$result = $this->getBackend()->getMany($preparedIds);
		
		if (empty($result)) {
			return $result;
		}
		
		if ($this->_namespace !== null) {
			$ids = array_intersect_key(array_combine($preparedIds, $id), $result);
			return array_combine(array_values($ids), array_values($result));
		}
		
		return $result;
	}
1332805
public function getResource(string $id = null): array
    {
        if ($id) {
            if (is_numeric($id)) {
                $filter = array_filter($this->resource, function ($row) use ($id) { return $row['id'] == $id; });
                return (array) array_pop($filter);
            }
            return (array) ($this->resource[$id] ?? []);
        }
        return $this->resource;
    }
395495
public function getAction($id)
    {
        $find = function($id) {
            /** @var Group $group */
            $group = $this->getDoctrine()
                ->getRepository(static::$entityName)
                ->findGroupById($id);

            return $group;
        };

        $view = $this->responseGetById($id, $find);

        return $this->handleView($view);
    }
934458
public function getLastUpdate($id = null)
    {
        if ($id) {
            $result = $this->getEntityManager()->createQuery('
                SELECT
                    i.date_update
                FROM
                    AnimeDbCatalogBundle:Item i
                WHERE
                    i.id = :id'
            )
                ->setParameter(':id', $id)
                ->getOneOrNullResult();
        } else {
            $result = $this->getEntityManager()->createQuery('
                SELECT
                    i.date_update
                FROM
                    AnimeDbCatalogBundle:Item i
                ORDER BY
                    i.date_update DESC'
            )
                ->setMaxResults(1)
                ->getOneOrNullResult();
        }

        return $result ? $result['date_update'] : null;
    }
28913
public function getOriginalEntityState($id)
    {
        if (isset($this->entityStateReferences[$id])) {
            return $this->entityStateReferences[$id];
        }

        return null;
    }