Ejemplo n.º 1
0
 /**
  * Imports article. Returns import status.
  *
  * @param array $data DB row array.
  *
  * @return string $oxid Id on success, bool FALSE on failure.
  */
 public function import($data)
 {
     if (isset($data['OXID'])) {
         $this->checkIdField($data['OXID']);
     }
     return parent::import($data);
 }
Ejemplo n.º 2
0
 /**
  * Imports user. Returns import status.
  *
  * @param array $data db row array
  *
  * @throws Exception If user exists with provided OXID, throw an exception.
  *
  * @return string $oxid on success, bool FALSE on failure
  */
 public function import($data)
 {
     if (isset($data['OXUSERNAME'])) {
         $id = $data['OXID'];
         $userName = $data['OXUSERNAME'];
         $user = oxNew("oxUser", "core");
         $user->oxuser__oxusername = new oxField($userName, oxField::T_RAW);
         if ($user->exists($id) && $id != $user->getId()) {
             throw new Exception("USER {$userName} already exists!");
         }
     }
     return parent::import($data);
 }