Esempio n. 1
0
 /**
  * Parser constructor.
  */
 public function __construct()
 {
     $this->dao = \dao\DaoFactory::getFactory()->getDaoProductImpl();
     try {
         $this->xml = simplexml_load_file('../xmlForParse.xml');
     } catch (\Exception $e) {
         $e->getMessage();
     }
 }
 /**
  * The function create new category in database
  *
  * @param $codeCategory
  * @param $name
  * @return models\Category
  */
 public function createCategory($codeCategory, $name)
 {
     $entityManager = DaoFactory::getFactory()->getEntityManager();
     $category = new models\Category();
     $category->setCodeCategory($codeCategory);
     $category->setName($name);
     $entityManager->persist($category);
     $entityManager->flush();
     return $category;
 }
 /**
  * DaoProductImpl constructor.
  */
 public function __construct()
 {
     $this->entityManager = DaoFactory::getFactory()->getEntityManager();
 }
 /**
  * Verifies user's cookies
  */
 private function checkCookie()
 {
     if (isset($_COOKIE['field1'][$this->sessionName]) && isset($_COOKIE['field2'][$this->sessionName])) {
         $user = DaoFactory::getUserDao()->get($_COOKIE["field1"][$this->sessionName]);
         if (!is_null($user)) {
             $id = $user->getId();
             if ($this->getSecretPhrase($id, $user->getEmail(), $user->getPassword()) == $_COOKIE['field2'][$this->sessionName]) {
                 $this->makeSession($id, $user->getCompanyId());
             }
         }
     }
 }
 /**
  * Public constructor
  */
 public function __construct()
 {
     $this->dao = DaoFactory::getUserDao();
 }
 /**
  * Public constructor
  */
 public function __construct()
 {
     $this->dao = DaoFactory::getFileDao();
     $this->auth = Authorization::getInstance(SESSION_NAME_DEFAULT, COOKIE_DOMAIN);
 }