Scalr\Api\Service\User\V1beta0\Adapter\ImageAdapter::_added PHP Method

_added() protected method

protected _added ( $from, $to, $action )
    protected function _added($from, $to, $action)
    {
        switch ($action) {
            case self::ACT_CONVERT_TO_OBJECT:
                $to->added = self::convertOutputValue('datetime', $from->getDtAdded());
                break;
            case self::ACT_CONVERT_TO_ENTITY:
                //nothing to do, as this property is not alterable
                break;
            case self::ACT_GET_FILTER_CRITERIA:
                if ($from->added === null) {
                    return [['$or' => [['dtAdded' => null], ['$and' => [['dtAdded' => ['$gte' => DateTime::createFromFormat("Y", Image::NULL_YEAR)]], ['dtAdded' => ['$lt' => DateTime::createFromFormat("Y", Image::NULL_YEAR + 1)]]]]]]];
                } else {
                    return [['dtAdded' => static::convertInputValue('datetime', $from->added, 'added')]];
                }
        }
    }