Pimcore\Model\Tool\Targeting\Persona\Dao::update PHP Method

update() public method

public update ( )
    public function update()
    {
        try {
            $type = get_object_vars($this->model);
            foreach ($type as $key => $value) {
                if (in_array($key, $this->getValidTableColumns("targeting_personas"))) {
                    if (is_array($value) || is_object($value)) {
                        $value = Serialize::serialize($value);
                    }
                    if (is_bool($value)) {
                        $value = (int) $value;
                    }
                    $data[$key] = $value;
                }
            }
            $this->db->update("targeting_personas", $data, $this->db->quoteInto("id = ?", $this->model->getId()));
        } catch (\Exception $e) {
            throw $e;
        }
    }