Example #1
0
 /**
  * Add a user with full set of data
  *
  * @param   array   $data
  * @param   bool    $setRole
  *
  * @return  int
  * @api
  */
 public function addUser($data, $setRole = true)
 {
     return parent::addUser($data, $setRole);
 }
Example #2
0
 /**
  * Add a user with full set of data
  *
  * Full procedure:
  *
  * - Add account data and get uid
  * - Add profile data
  * - Add compound data, multiple, if any
  * - Add custom data, multiple, if any
  *
  * @param   array   $data
  * @param   bool    $setRole
  *
  * @return  int|array uid or uid and error of account/profile/compound
  * @api
  */
 public function addUser($data, $setRole = true)
 {
     $error = array();
     $uid = parent::addUser($data, $setRole);
     if (!$uid) {
         $error[] = 'account';
     } else {
         $status = $this->addProfile($uid, $data);
         if (!$status) {
             $error[] = 'profile';
         }
         $status = $this->addCompound($uid, $data);
         if (!$status) {
             $error[] = 'compound';
         }
         /*
         $status = $this->addCustom($uid, $data);
         if (!$status) {
             $error[] = 'custom';
         }
         */
     }
     return $error ? array($uid, $error) : $uid;
 }