setCulture('sk'); } public function addMessage($message) { $m = $this->getAttribute('message', array(), 'user'); $m[] = $message; $this->setAttribute('message', $m, 'user'); } public function getMessages() { $result = $this->getAttribute('message', array(), 'user'); $this->setAttribute('message', array(), 'user'); // vymazu return $result; } public function hasMessages() { $result = $this->getAttribute('message', array(), 'user'); return (count($result) > 0); } public function addError($message) { $m = $this->getAttribute('error', array(), 'user'); $m[] = $message; $this->setAttribute('error', $m, 'user'); } public function getErrors() { $result = $this->getAttribute('error', array(), 'user'); $this->setAttribute('error', array(), 'user'); // vymazu return $result; } public function hasErrors() { $result = $this->getAttribute('error', array(), 'user'); return (count($result) > 0); } public function getBasket() { if(!$basket = $this->getAttribute('basket', false, 'user')) { $basket = new Basket(); $this->setAttribute('basket', $basket, 'user'); } return $basket; } }