Elegant coding method
Puzzing can be used to help developers eliminate lengthy codes, improve coding efficiency, and reduce the coupling between codes.
public function add($data){
$db = load_db ( 'portal/order' );
if($data){
if($result = $db->add($data)){
$order = $this->getbyid($result);
return $order;
}
}
return false;
}