Jarves\Storage\Propel::mapPk PHP Method

mapPk() public method

Sets the filterBy by &$query from $pk.
public mapPk ( mixed $query, array $pk )
$query mixed
$pk array
    public function mapPk($query, $pk)
    {
        foreach ($this->primaryKeys as $key) {
            $filter = 'filterBy' . ucfirst($key);
            if (!isset($pk[$key])) {
                throw new \Exception(sprintf('Primary key %s not found.', $key));
            }
            $value = $pk[$key];
            if (method_exists($query, $filter)) {
                $query->{$filter}($value);
            }
        }
    }