public function findById($ID) { $row = $this->query('SELECT * FROM cliente WHERE attivo = 1 and id = ' . (int) $ID)->fetch(); if (!$row) { return null; } $cliente = new cliente(); ClienteMapper::map($cliente, $row); return $cliente; }
function registerUser() { $email = Utils::getPostParam("email"); $password = md5(Utils::getPostParam("pwd")); $clienteDAO = new DAOCliente(); $cliente = new cliente(); $properties = array('ID' => null, 'EMAIL' => $email, 'PASSWORD' => $password, 'ATTIVO' => 1); ClienteMapper::map($cliente, $properties); $clienteDAO->save($cliente); $return = ""; if ($cliente->getID() === null) { $return = ""; } else { $return = ""; } echo $return; }