Forms\Controller\Api::saveentry PHP Method

saveentry() public method

public saveentry ( )
    public function saveentry()
    {
        $form = $this->param("form", null);
        $entry = $this->param("entry", null);
        if ($form && $entry) {
            $frm = "form" . $form["_id"];
            $entry["modified"] = time();
            $entry["_uid"] = @$this->user["_id"];
            if (!isset($entry["_id"])) {
                $entry["created"] = $entry["modified"];
            }
            $this->app->db->save("forms/{$frm}", $entry);
        }
        return $entry ? json_encode($entry) : '{}';
    }