createNewUserAndRetrieveId($email, $password); Response::respondSuccess(array( 'userId' => $userId, 'userEmail' => $email )); } public function createNewUserAndRetrieveId($email, $password) { $userInstance = new User(); $userInstance->setProperties(array( 'email' => $email, 'password' => Hashing::hashPassword($password) )); return $userInstance->store(); } }