Pimcore\Model\Tool\Tag\Config\Dao::save PHP Метод

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

public save ( )
    public function save()
    {
        $ts = time();
        if (!$this->model->getCreationDate()) {
            $this->model->setCreationDate($ts);
        }
        $this->model->setModificationDate($ts);
        try {
            $dataRaw = get_object_vars($this->model);
            $data = [];
            $allowedProperties = ["name", "description", "items", "siteId", "urlPattern", "textPattern", "httpMethod", "params", "creationDate", "modificationDate"];
            foreach ($dataRaw as $key => $value) {
                if (in_array($key, $allowedProperties)) {
                    $data[$key] = $value;
                }
            }
            $this->db->insertOrUpdate($data, $this->model->getName());
        } catch (\Exception $e) {
            throw $e;
        }
    }