Exemplo 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();
 }