Create the user on persistent storage
@return bool Will return TRUE if user has been created on persistent storage, else FALSE
542719
public function create()
    {
        if ($this->createStatement == null) {
            $this->createStatement = $this->connection->prepare("
            INSERT INTO User (username,mail,password,id,parent) VALUES (?,?,?,?,?)");
            $this->createStatement->bindParam(1, $this->username);
            $this->createStatement->bindParam(2, $this->mail);
            $this->createStatement->bindParam(3, $this->password);
            $this->createStatement->bindParam(4, $this->userId);
            $this->createStatement->bindParam(5, $this->parentID);
        }
        try {
            $this->createStatement->execute();
        } catch (PDOException $e) {
            return false;
        }
        $this->setInitialValues();
        return $this->exists();
    }
123729
public function create(): bool
    {
        if ($this->isCreate()) {
            throw new Exception\RuntimeException('Memory table have been created, cannot recreated');
        }

        // Init memory table instace
        $table = new SwooleTable($this->getSize());
        $this->setTable($table);

        // Set columns
        foreach ($this->columns as $field => $fieldValue) {
            $args = array_merge([$field], $fieldValue);
            $this->table->column(...$args);
        }

        // Create memory table
        $result = $table->create();

        // Change memory table create status
        $this->setCreate(true);
        return $result;
    }
1370617
public function save()
    {
        if ($this->validate()) {
            $this->user->scenario = User::SCENARIO_PASSWORD;
            $this->user->password = $this->new_password;
            return $this->user->save();
        }
        return false;
    }
1026552
final public function create() {

		$app = Application::getInstance();
		$class = get_called_class();
		
		if (!$this->areKeysPopulated() and !$this->db->isAutoIncrement(static::TABLE_NAME)) {
			$app->logEvent('The object’s ' . implode(', ', $this->keyProperties) . ' properties must be populated in order to create a ' . $class . ' record');
			return FALSE;
		}
		
		// hook for tasks to be executed before creation
		$this->beforeCreate();
		
		// get list of class property names
		$props = array_keys(static::getBinds());
		
		// insert the object as db record
		$dbObj = $this->prepareData($props);
		$res = $this->db->insertObject(static::TABLE_NAME, $dbObj);

		// get last insert id if not compound key
		if (!static::hasCompoundKey()) {

			$lastInsertId = $this->db->getLastInsertId();
		
			$key = $this->keyProperties[0];
			
			if ('int' == $this->getPropertyType($key)) {
				$this->{$key} = (int)$lastInsertId;
			} else {
				$this->{$key} = $lastInsertId;
			}
			
		}

		// set logs
		$keyParts = array();
			
		foreach ($this->keyProperties as $prop) {
			$keyParts[] = $prop . '=' . $this->{$prop};
		}
		
		// log as application event
		$app->logEvent('Created a new ' . $class . ' object with ' . implode(', ' , $keyParts));
		
		// hook for tasks to be executed after creation
		$this->afterCreate();
		
		return (bool)$res;
	
	}
783874
public function create()
    {
        if (!$this->name) {
            throw new UnexpectedValueException(
                'Cannot create a user with no name'
            );
        }

        $parts = array('CREATE USER :user');
        $params = array(':user' => $this->name);

        if ($this->host) {
            $parts[] = '@:host';
            $params[':host'] = strtolower($this->host) == 'any' ? '%' : $this->host;
        }
        if ($this->password) {
            $parts[] = 'IDENTIFIED BY :password';
            $params[':password'] = $this->password;
        }

        // Wrap in 'FLUSH PRIVILEGES' commands to update in-memory state
        $this->client->execute('FLUSH PRIVILEGES');
        $this->client->execute(implode(' ', $parts), $params);
        $this->client->execute('FLUSH PRIVILEGES');
    }
665395
public static function user()
    {
        if (Session::has('user')) {
            $userModel = Config::get('user');
            $model = new $userModel();

            return $model->find(Session::get('user'));
        }
        return false;
    }
476560
public function create(User $user)
    {
        /* handle encode */
        $user = $this->encode($user);

        $this->getEm()->persist($user);
        $this->getEm()->flush();

        return $user;
    }
658487
private function persist()
    {
        $items = $this->persistableList();

        $this->session->set('stack', $items);

        $user = $this->users->getCurrentUser();
        $user['stack'] = $items;
        $this->users->saveUser($user);
    }
1217500
public function createUser(User $user)
    {
        $query = $this->handler->createInsertQuery();
        $query
            ->insertInto($this->handler->quoteTable('ezuser'))
            ->set(
                $this->handler->quoteColumn('contentobject_id'),
                $query->bindValue($user->id, null, \PDO::PARAM_INT)
            )->set(
                $this->handler->quoteColumn('login'),
                $query->bindValue($user->login)
            )->set(
                $this->handler->quoteColumn('email'),
                $query->bindValue($user->email)
            )->set(
                $this->handler->quoteColumn('password_hash'),
                $query->bindValue($user->passwordHash)
            )->set(
                $this->handler->quoteColumn('password_hash_type'),
                $query->bindValue($user->hashAlgorithm, null, \PDO::PARAM_INT)
            );
        $query->prepare()->execute();

        $query = $this->handler->createInsertQuery();
        $query
            ->insertInto($this->handler->quoteTable('ezuser_setting'))
            ->set(
                $this->handler->quoteColumn('user_id'),
                $query->bindValue($user->id, null, \PDO::PARAM_INT)
            )->set(
                $this->handler->quoteColumn('is_enabled'),
                $query->bindValue($user->isEnabled, null, \PDO::PARAM_INT)
            )->set(
                $this->handler->quoteColumn('max_login'),
                $query->bindValue($user->maxLogin, null, \PDO::PARAM_INT)
            );
        $query->prepare()->execute();
    }
698481
public function saveUser($user) {
        global $DB;

        $now = time();
        $isinsert = is_null($user->created);
        $user->updated = $now;

        $params = [
            'ltiresultsourcedid' => $user->ltiResultSourcedId,
            'updated' => $user->updated
        ];

        if ($isinsert) {
            $params['resourcelinkid'] = $user->getResourceLink()->getRecordId();
            $params['ltiuserkey'] = $user->getId(ToolProvider\ToolProvider::ID_SCOPE_ID_ONLY);
            $user->created = $now;
            $params['created'] = $user->created;
            $id = $DB->insert_record($this->userresulttable, (object) $params);
            if ($id) {
                $user->setRecordId($id);
                return true;
            }

        } else {
            $params['id'] = $user->getRecordId();
            return $DB->update_record($this->userresulttable, (object) $params);
        }

        return false;
    }
1151011
public function load($user, $storage = 'mysql')
	{
		if (!empty($storage) && !in_array($storage, array('mysql', 'author', 'xregistration')))
		{
			$this->setError('Invalid storage option requested [' . $storage . ']');
			return false;
		}

		if ($storage == 'mysql')
		{
			return $this->_mysql_load($user);
		}

		if ($storage == 'author')
		{
			return $this->_mysql_load_author($user);
		}

		if ($storage == 'xregistration')
		{
			return $this->_xregistration_load($user);
		}

		return true;
	}
286378
private function createUsers()
    {
        if($this->option('users')
            || $this->option('users_per_role')
            || $this->option('all')
        ) {

            $this->comment('Creating dummy users...');
            $output = (new \UserSeeder())
                ->setCommand($this)
                ->run(
                    $this->getDefaultOption('users'),
                    $this->getDefaultOption('users_per_role'),
                    $this->getDefaultOption('role_id')
                );
            $this->info($output);
        }
        return $this;
    }
859226
public function createUser()
    {
        /* @var User $user */
        $user = parent::createUser();

        $userStat = new UserStat();
        $user->setUserStat($userStat);
        return $user;
    }
919439
public function createVersion()
    {
        if (!file_exists($this->owner->getFullPath())) {
            return false;
        }

        $version = new FileVersion();
        $version->FileID = $this->owner->ID;
        $version->write();

        $this->owner->CurrentVersionID = $version->ID;
        return (bool) $this->owner->write();
    }
199279
public function create()
	{
		// create a new session
		$this->keys['session_id']	= $this->_new_session_id();
		$this->keys['previous_id']	= $this->keys['session_id'];	// prevents errors if previous_id has a unique index
		$this->keys['ip_hash']		= md5(\Input::ip().\Input::real_ip());
		$this->keys['user_agent']	= \Input::user_agent();
		$this->keys['created'] 		= $this->time->get_timestamp();
		$this->keys['updated'] 		= $this->keys['created'];

		return $this;
	}
1044652
private function _initUser()
	{
		$this->_user = Agl::getModel(self::USER_DB_CONTAINER);
		if ($this->_session->userId) {
			$this->_user->loadById($this->_session->userId);
		}

		return $this;
	}
1293270
public function persist()
    {

        $this->ensureRootDirectory();

        $someoneSaved = false;
        foreach ($this->storages as $url=>$storage) {
            $this->ensureStorageDirectory($url);
            if ($storage->persist()) {
                $someoneSaved = true;
            }
        }

        foreach ($this->purgeQueue as $url) {
            $storage = $this->getOrCreateStorage($url);
            if ($storage->purge()) {
                $someoneSaved = true;
            }
            $this->removeStorageIfLoaded($url);
        }

        $this->purgeQueue = [];

        return $someoneSaved;
    }