/** * The function updates the name of the vendor against his published number * * @var array */ public function setName($token, $name) { $retval = []; $retval['code'] = 0; try { \DB::update('update vendor set name = ? where token = ?', array($name, $token)); } catch (\Exception $e) { $retval['code'] = $e->errorInfo[0]; } return $retval; }