protected function query($query, $where = null, $size = null, $offset = null)
    {
        $params = [];

        if (is_array($where)) {
            $conditions = [];
            foreach($where as $column => $value) {
                $placeholder = '?';
                $value = '' . $value;

                $conditions[] = $column . ' = ' . $placeholder;
                $params[] = $value;
            }
            if (count($conditions)) {
                $query .= ' WHERE ' . implode(' AND ', $conditions);
            }
        }

        if (!is_null($size)) {
            $query = $this->getPersistence()->getPlatForm()->limitStatement($query, $size, $offset);
        }

        return $this->getPersistence()->query($query, $params);
    }
protected function query($query, $where = null, $size = null, $offset = null)
    {
        $params = [];

        if (is_array($where)) {
            $conditions = [];
            foreach($where as $column => $value) {
                $placeholder = '?';
                $value = '' . $value;

                $conditions[] = $column . ' = ' . $placeholder;
                $params[] = $value;
            }
            if (count($conditions)) {
                $query .= ' WHERE ' . implode(' AND ', $conditions);
            }
        }

        if (!is_null($size)) {
            $query = $this->getPersistence()->getPlatForm()->limitStatement($query, $size, $offset);
        }

        return $this->getPersistence()->query($query, $params);
    }
protected function query ( $ query , $ where = null , $ size = null , $ offset = null ) { $ params = [ ] ; if ( is_array ( $ where ) ) { $ conditions = [ ] ; foreach ( $ where as $ column => $ value ) { $ placeholder = '?' ; $ value = '' . $ value ; $ conditions [ ] = $ column . ' = ' . $ placeholder ; $ params [ ] = $ value ; } if ( count ( $ conditions ) ) { $ query .= ' WHERE ' . implode ( ' AND ' , $ conditions ) ; } } if ( ! is_null ( $ size ) ) { $ query = $ this -> getPersistence ( ) -> getPlatForm ( ) -> limitStatement ( $ query , $ size , $ offset ) ; } return $ this -> getPersistence ( ) -> query ( $ query , $ params ) ; }
Builds and runs a query
@param string $query
@param array $where
@param int $size
@param int $offset
@return PDOStatement
Builds and runs a query