Pimcore\Model\Document\Tag\Snippet::getFromWebserviceImport PHP Метод

getFromWebserviceImport() публичный Метод

public getFromWebserviceImport ( Pimcore\Model\Webservice\Data\Document\Element $wsElement, $document = null, mixed $params = [], null $idMapper = null )
$wsElement Pimcore\Model\Webservice\Data\Document\Element
$params mixed
$idMapper null
    public function getFromWebserviceImport($wsElement, $document = null, $params = [], $idMapper = null)
    {
        $data = $wsElement->value;
        if ($data->id !== null) {
            $this->id = $data->id;
            if (is_numeric($this->id)) {
                $this->snippet = Document\Snippet::getById($this->id);
                if (!$this->snippet instanceof Document\Snippet) {
                    throw new \Exception("cannot get values from web service import - referenced snippet with id [ " . $this->id . " ] is unknown");
                }
            } else {
                throw new \Exception("cannot get values from web service import - id is not valid");
            }
        }
    }