Pimcore\Model\Document\Tag\Date::getFromWebserviceImport PHP Method

getFromWebserviceImport() public method

Receives a Webservice\Data\Document\Element from webservice import and fill the current tag's data
public getFromWebserviceImport ( Pimcore\Model\Webservice\Data\Document\Element $wsElement, $document = null, mixed $params = [], $idMapper = null )
$wsElement Pimcore\Model\Webservice\Data\Document\Element
$params mixed
$idMapper
    public function getFromWebserviceImport($wsElement, $document = null, $params = [], $idMapper = null)
    {
        if (!$wsElement or empty($wsElement->value)) {
            $this->date = null;
        } elseif (is_numeric($wsElement->value)) {
            $this->setDateFromTimestamp($wsElement->value);
        } else {
            throw new \Exception("cannot get document tag date from WS - invalid value [  " . $wsElement->value . " ]");
        }
    }