GDS\Gateway\RESTv1::configureObjectValueParamForQuery PHP Method

configureObjectValueParamForQuery() protected method

Configure a Value parameter, based on the supplied object-type value
protected configureObjectValueParamForQuery ( object $obj_val, object $mix_value )
$obj_val object
$mix_value object
    protected function configureObjectValueParamForQuery($obj_val, $mix_value)
    {
        if ($mix_value instanceof Entity) {
            /** @var Entity $mix_value */
            $obj_val->keyValue = $this->applyPartition((object) ['path' => $this->createMapper()->buildKeyPath($mix_value)]);
        } elseif ($mix_value instanceof \DateTime) {
            $obj_val->timestampValue = $mix_value->format(\GDS\Mapper\RESTv1::DATETIME_FORMAT);
        } elseif (method_exists($mix_value, '__toString')) {
            $obj_val->stringValue = $mix_value->__toString();
        } else {
            throw new \InvalidArgumentException('Unexpected, non-string-able object parameter: ' . get_class($mix_value));
        }
    }