src/FilterSetting/Perimetersearch.php
protected function getFromCache($address, $country)
    {
        $builder = $this->connection->createQueryBuilder();
        $builder
            ->select('*')
            ->from($this->connection->quoteIdentifier('tl_metamodel_perimetersearch'))
            ->where($builder->expr()->eq($this->connection->quoteIdentifier('search'), ':search'))
            ->andWhere($builder->expr()->eq($this->connection->quoteIdentifier('country'), ':country'))
            ->setParameter('search', $address)
            ->setParameter('country', $country);

        $statement = $builder->execute();

        // If we have no data just return null.
        if (!$statement->rowCount()) {
            return null;
        }

        $result = $statement->fetch(\PDO::FETCH_OBJ);

        // Build a new container.
        $container = new Container();
        $container->setLatitude($result->geo_lat);
        $container->setLongitude($result->geo_long);
        $container->setSearchParam(
            \strtr(
                $builder->getSQL(),
                [
                    ':search'  => $this->connection->quote($address),
                    ':country' => $this->connection->quote($country)
                ]
            )
        );

        return $container;
    }
protected function getFromCache($address, $country)
    {
        $builder = $this->connection->createQueryBuilder();
        $builder
            ->select('*')
            ->from($this->connection->quoteIdentifier('tl_metamodel_perimetersearch'))
            ->where($builder->expr()->eq($this->connection->quoteIdentifier('search'), ':search'))
            ->andWhere($builder->expr()->eq($this->connection->quoteIdentifier('country'), ':country'))
            ->setParameter('search', $address)
            ->setParameter('country', $country);

        $statement = $builder->execute();

        // If we have no data just return null.
        if (!$statement->rowCount()) {
            return null;
        }

        $result = $statement->fetch(\PDO::FETCH_OBJ);

        // Build a new container.
        $container = new Container();
        $container->setLatitude($result->geo_lat);
        $container->setLongitude($result->geo_long);
        $container->setSearchParam(
            \strtr(
                $builder->getSQL(),
                [
                    ':search'  => $this->connection->quote($address),
                    ':country' => $this->connection->quote($country)
                ]
            )
        );

        return $container;
    }
protected function getFromCache ( $ address , $ country ) { $ builder = $ this -> connection -> createQueryBuilder ( ) ; $ builder -> select ( '*' ) -> from ( $ this -> connection -> quoteIdentifier ( 'tl_metamodel_perimetersearch' ) ) -> where ( $ builder -> expr ( ) -> eq ( $ this -> connection -> quoteIdentifier ( 'search' ) , ':search' ) ) -> andWhere ( $ builder -> expr ( ) -> eq ( $ this -> connection -> quoteIdentifier ( 'country' ) , ':country' ) ) -> setParameter ( 'search' , $ address ) -> setParameter ( 'country' , $ country ) ; $ statement = $ builder -> execute ( ) ; // If we have no data just return null. if ( ! $ statement -> rowCount ( ) ) { return null ; } $ result = $ statement -> fetch ( \ PDO :: FETCH_OBJ ) ; // Build a new container. $ container = new Container ( ) ; $ container -> setLatitude ( $ result -> geo_lat ) ; $ container -> setLongitude ( $ result -> geo_long ) ; $ container -> setSearchParam ( \ strtr ( $ builder -> getSQL ( ) , [ ':search' => $ this -> connection -> quote ( $ address ) , ':country' => $ this -> connection -> quote ( $ country ) ] ) ) ; return $ container ; }
Get data from cache.

@param string $address The address which where use for the search.
@param string $country The country.

@return Container|null
Get data from cache .