/** * Metoda zwraca ostanie n haseł dla użytkownika * @param type $changeOffset - ilość haseł (domyślnie 10). * W przypadku braku haseł dla użytkownika zwracane jest FALSE * @return boolean * @throws Exception */ public function getOldPasswords($changeOffset = 10) { $userPassword = new UserPassword(); $id = Zend_Auth::getInstance()->getIdentity()->id; if (is_null($id)) { throw new Exception('Pole id jest puste'); } $select = $userPassword->select()->from($userPassword->getName(), array('password'))->where('id_user = ?', $id)->order('id DESC')->limit(intval($changeOffset))->setIntegrityCheck(false); $passArray = $userPassword->getAdapter()->fetchCol($select); if ($passArray && count($passArray) > 0) { return $passArray; } return FALSE; }