Create a new identity record linked with this user

@param array $data Hash array with col->value pairs to save
@return int  The inserted identity ID or false on error
973601
function insert_identity($data)
    {
        if (!$this->ID)
            return false;

        unset($data['user_id']);

        $insert_cols   = array();
        $insert_values = array();

        foreach ((array)$data as $col => $value) {
            $insert_cols[]   = $this->db->quote_identifier($col);
            $insert_values[] = $value;
        }

        $insert_cols[]   = $this->db->quote_identifier('user_id');
        $insert_values[] = $this->ID;

        $sql = "INSERT INTO ".$this->db->table_name('identities', true).
            " (`changed`, ".join(', ', $insert_cols).")".
            " VALUES (".$this->db->now().", ".join(', ', array_pad(array(), count($insert_values), '?')).")";

        $insert = $this->db->query($sql, $insert_values);

        // clear the cache
        $this->identities = array();
        $this->emails     = null;

        return $this->db->insert_id('identities');
    }
1079841
public function createNewRecord($data) {
        $list_email = new $this->model;

        $list_email->title      = $data['list_id']." ".$data['email_id'];
        $list_email->list_id    = $data['list_id'];
        $list_email->email_id   = $data['email_id'];
        $list_email->comments   = $data['comments'];
        $list_email->enabled    = $data['enabled'];
        $list_email->created_at = $data['created_at'];
        $list_email->created_by = $data['created_by'];
        $list_email->updated_at = $data['updated_at'];
        $list_email->updated_by = $data['updated_by'];
        $list_email->locked_at  = null;
        $list_email->locked_by  = null;

        if ($list_email->save()) {

            // Return the new ID
            return $list_email->id;
        }

        return false;
    }
235947
protected function create(array $data)
    {
        if (!isset($data['name']) || trim($data['name']) == '') {
            $data['name'] = $data['email'];
        }
        $user = User::create([
            'name' => $data['name'],
            'email' => $data['email'],
            'password' => bcrypt($data['password']),
            ]);
        return $user;
    }
967383
public function create(array $data)
    {
        if (array_key_exists('password', $data)) {
            $data['password'] = bcrypt($data['password']);
        }

        return parent::create($data);
    }
491839
public function updateData($data) {
		$Model = ClassRegistry::init($this->_authenticateObject->settings['userModel']);
		$Model->id = $this->_user[$Model->primaryKey];
		$userData = $Model->save($data, false);
		$this->_user = array_merge((array) $this->_user, $userData[$Model->alias]);
		$this->Auth->login($this->_user);
		return $userData;
	}
283961
public function create(array $data)
    {
        $data = self::mergeData($data, [
            'finished' => false,
            'smContactTaskReq' => [
                'id' => false,
            ],
        ]);

        return $this->client->doPost('contact/updateTask', $data);
    }
489626
public function create(array $data)
    {
        try
        {
            if ( $this->validator->with($data)->passes() )
            {
                $this->users->create($data,$data['activate']);
                return true;
            }
        }
        catch (LoginRequiredException $e)
        {
            $this->validator->add('LoginRequiredException',$e->getMessage());
        }
        catch (PasswordRequiredException $e)
        {
            $this->validator->add('PasswordRequiredException',$e->getMessage());
        }
        catch (UserExistsException $e)
        {
            $this->validator->add('UserExistsException',$e->getMessage());
        }

        return false;
    }
1009795
public function createUserFromOAuth($data)
    {
        $user = $this->createUser();
        $user->setAuthDataByProvider($data['provider'], ['id' => $data['id'], 'token' => $data['token']]);
        $user->setAuthProvider($data['provider']);
        $user->setFirstAuthProvider($data['provider']);
        $user->setUsername($data['email']);
        $user->setEmail($data['email']);
        $user->setPassword('none');
        $user->setEnabled(true);
        $user->setContact(new Contact);

        return $user;
    }
463197
public function createIdentifier($data)
	{
		// Get the data ready for creation.
		switch(gettype($data))
		{
			// Use an Object to update.
			case 'object':
				// Add entity type and key to creation data.
				$createData = ['entity_type' => $data->getType(), 'entity_id' => $data->getKey()];
			break;

			default:
				$createData = $data;
			break;
		}

		// Create the newly created entity's EntityIdentifier.
		return $this->aggregate[IdentifierServiceProvider::getProviderKey()]->create($createData);
	}
295421
public function add(array $data)
    {
        $result = null;
        $this->hook->attach('user.add.before', $data, $result, $this);

        if (isset($result)) {
            return (int) $result;
        }

        if (empty($data['name'])) {
            $data['name'] = strtok($data['email'], '@');
        }

        $data['created'] = $data['modified'] = GC_TIME;
        $data['hash'] = gplcart_string_hash($data['password']);
        $result = $data['user_id'] = $this->db->insert('user', $data);

        $this->setAddress($data);

        $this->hook->attach('user.add.after', $data, $result, $this);
        return (int) $result;
    }
1021787
public static function createFromArray(array $data)
    {
        $self = new self();

        if (isset($data['id'])) {
            $self->setId($data['id']);
        }
        if (isset($data['content'])) {
            $self->setContent($data['content']);
        }
        if (isset($data['unverified'])) {
            $self->setUnverified($data['unverified']);
        }
        if (isset($data['excluded'])) {
            $self->setExcluded($data['excluded']);
        }
        if (isset($data['plural_suffix'])) {
            $self->setPluralSuffix($data['plural_suffix']);
        }
        if (isset($data['created_at'])) {
            $self->setCreatedAt($data['created_at']);
        }
        if (isset($data['updated_at'])) {
            $self->setUpdatedAt($data['updated_at']);
        }
        if (isset($data['placeholders'])) {
            $self->setPlaceholders($data['placeholders']);
        }
        if (isset($data['word_count'])) {
            $self->setWordCount($data['word_count']);
        }
        if (isset($data['key']) && is_array($data['key'])) {
            $self->setKey(Key::createFromArray($data['key']));
        }
        if (isset($data['locale']) && is_array($data['locale'])) {
            $self->setLocale(Locale::createFromArray($data['locale']));
        }
        if (isset($data['user']) && is_array($data['user'])) {
            $self->setUser(User::createFromArray($data['user']));
        }

        return $self;
    }
883677
public static function createUser(array $data): array
    {
        $client = self::getServerClient();
        $params = array_only($data, ['name', 'email', 'cpf']);

        $response = $client->post('api/' . config('openid.api-version') . '/user', [
            'form_params' => $params,
        ]);

        return json_decode($response->getBody(), TRUE);
    }
160963
public function insert($data)
    {
        $row = $this->getTable()->insert($data);
        if (!$row instanceof IRow) {
            return $row;
        }

        if ($this->auditLogRepository) {
            $to = $this->filterValues($this->excludeColumns((array)$data));

            $data = [
                'version' => '1',
                'from' => [],
                'to' => $to,
            ];
            $this->pushAuditLog(AuditLogRepository::OPERATION_CREATE, $row->getSignature(), $data);
        }

        return $row;
    }
1247915
public static function createFromArray(array $data)
    {
        $self = new self();

        if (isset($data['id'])) {
            $self->setId($data['id']);
        }
        if (isset($data['name'])) {
            $self->setName($data['name']);
        }
        if (isset($data['code'])) {
            $self->setCode($data['code']);
        }

        return $self;
    }
364108
public static function CreateFromResponse(array $data)
    {
        if (array_key_exists("data", $data) && is_array($data["data"]))
        {
            $data = $data["data"];
        }

        $object_field = new self($data["alias"], $data["type"], $data["options"], $data["required"], $data["unique"]);
        if ($data["field"])
        {
            $object_field->setField($data["field"]);
        }
        if ($data["id"])
        {
            $object_field->setId($data["id"]);
        }
        return $object_field;
    }
1037912
public function createSignatureCredentials(array $data)
    {
        $credentials = new SymmetricCredentials();
        $credentials->setMacId($data['access_token']);
        $credentials->setAlgorithm($data['mac_algorithm']);
        $credentials->setSharedKey($data['mac_key']);
        return $credentials;
    }
823637
public function createUser($data) {
        $user = new User;

        $user->name       = $data['name'];
        $user->email      = $data['email'];
        $user->password   = bcrypt($data['password']);

        if ($data['activated'] != "1") {
            $user->activated = 0;
        }

        if ($data['enabled'] != "1") {
            $user->enabled = 0;
        }


        // two factor authorization
        // the front-end registrationdoes not set a value for this field,
        // but the admin does
        if ($data['two_factor_auth_enabled'] != "1") {
            $user->two_factor_auth_enabled = 0;
        } else {
            $user->two_factor_auth_enabled = 1;
        }
        $user->phone_country_code      = $data['phone_country_code'];
        $user->phone_number            = $data['phone_number'];



        // When the admin is adding a new user, use their user id
        // for the created_by and updated_by fields. When no
        // one is logged in during this user creation process, it
        // means that someone is initiating their own registration
        // via the front-end. In which case, use the user id 
        // specified in the auth config file.

        if (isset(Auth::user()->id)) {
            $user->created_by  = Auth::user()->id;
            $user->updated_by  = Auth::user()->id;
        } else {
            $user->created_by  = config('lasallecmsusermanagement.auth_user_id_for_created_by_for_frontend_user_registration');
            $user->updated_by  = config('lasallecmsusermanagement.auth_user_id_for_created_by_for_frontend_user_registration');
        }

        // INSERT!
        $saveWentOk = $user->save();

        // If the save to the database table went ok, then let's INSERT related IDs into the pivot tables,
        if ($saveWentOk) {
            // INSERT into the pivot table
            $this->associateRelatedRecordsToNewRecord(
                $user,
                $data['groups'],
                'Lasallecms\Usermanagement\Models',
                'Group'
            );

            return true;
        }

        return false;
    }