We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37138
    • 12 Posts
    Hello,
    Please help, i need to set the feild published = 1 in this code. How to do it?
    function updateDocument($id=0, $update=array(), $where='')
    	
    	{
    		
    		$where = (($id != 0) ? "`id`='$id'" : "") . (($id != 0 && $where != '') ? " OR " : "") . $where;
    		if(! $upd = $this->db->update($update, $this->getFullTableName('site_content'), $where) )
    			$this->logError('updateDocument', $this->db->getLastError(), time());
    		
    		return $upd;
    	}
    

    following code is run via snippet
    function updateDocument($id, $tvs) {
            foreach ($tvs as $k => $v)
                $this->CakeModx->setTV($k, $id, $v);
        }