public function bindExecuteAndFetchAll($query, $parameters = [], $castModel = null)
    {
        $statement = $this->link->prepare($query);

        foreach ($parameters as $index => $paramProperties) {
            if (is_object($paramProperties)) {
                $paramProperties = (array) $paramProperties;
            }
            if (is_array($paramProperties)) {
                $statement->bindValue(
                    (int) $index + 1,
                    $paramProperties['value'],
                    $paramProperties['param']
                );
            } else {
                $statement->bindValue((int) $index + 1, $paramProperties);
            }
        }

        $statement->execute();
        $data = $statement->fetchAll(PDO::FETCH_ASSOC);

        return (
            $castModel && $data
            ? $data
            : $data
        );
    }