
Originally Posted by
Global Cooling
Should I use a setter and getter function for every variable that is provided by the user?
i.e. I am writing a database class that has a:
public function select($fields, $table, $where, $orderby, $limit)
should I process each one of those function parameters i.e:
public function select($fields, $table, $where, $orderby, $limit){
$this->setFields($fields);
$this->setTable($table);
$this->setWhere($where);
$this->setOrderby($orderby);
$this->setLimit($limit);
//Rest of code here
Thanks in advance!!!
Global
P.S. I am aware that PHP frameworks offer these classes but I would like to know the best practices for myself...
Bookmarks