Create a model

@param  array $data
@return Model
976899
protected function createModel($data) {
		$modelClass = $this->getModel();
			
		$model = $modelClass::factory($data);

		if ($this->hasDatagate()) {
			$model->setDatagate($this->getDatagate());
		}
		
		if ($this->hasLocator()) {
			$model->setLocator($this->getLocator());
		}
		
		return $model;
	}
651358
public static function make($data = [])
    {
        // filter empty values
        $data = array_filter($data);

        // remove auto data;
        unset($data['id']);
        unset($data['created_at']);
        unset($data['updated_at']);

        //
        $model = new static($data);

        return $model;
    }
369268
public function factory(array $data = [])
    {
        $model = $this->newQuery()->getModel()->newInstance();

        $this->setModelData($model, $data);

        return $model;
    }
637476
public function firstOrCreate(array $data)
    {
        if (!$row = $this->first($data)) {
            $row = $this->create($data);
        }

        return $row;
    }
1094535
public function create($data)
    {
        $descriptor = new ThrowsDescriptor($data->getName());
        $descriptor->setDescription($data->getDescription());
        $descriptor->setTypes(
            $this->builder->buildDescriptor(new Collection($data->getTypes()))
        );

        return $descriptor;
    }
501504
public function createClone($data = []) {
		$collection = static::factory($data, $this->getModel(), $this->getPrimary());
		
		if ($this->hasDatagate()) {
			$collection->setDatagate($this->getDatagate());
		}
		
		if ($this->hasLocator()) {
			$collection->setLocator($this->getLocator());
		}
		
		return $collection;
	}
234400
protected function makeRelatedModel($data)
    {
        $dataSource = (array) $data;
        $data = (array) $dataSource['data'];
        $fields = (array) $dataSource['meta']->fields;

        return new self($data, $fields);
    }
1367440
protected function buildModel(array $data = array()){
        $Model = NULL;
        if (isset($this->model)){
            $Model = new $this->model();
            $Model->setBaseUrl($this->getBaseUrl());
            if ($this->getAuth() !== NULL) {
                $Model->setAuth($this->getAuth());
            }
            if (!empty($data)){
                foreach($data as $key => $value){
                    $Model->set($key,$value);
                }
            }
        }
        return $Model;
    }
1167415
public static function createFromArray(array $data)
    {
        $self = new self();

        if (isset($data['assets'])) {
            $self->setAssets($data['assets']);
        }
        if (isset($data['locales'])) {
            $self->setLocales($data['locales']);
        }

        return $self;
    }
967383
public function create(array $data)
    {
        if (array_key_exists('password', $data)) {
            $data['password'] = bcrypt($data['password']);
        }

        return parent::create($data);
    }
671879
public static function add(array $data)
    {
        $model = Yii::createObject(static::className());
        $model->setAttributes($data);
        return $model->save() ?: $model;
    }
298166
public function create(array $data = array())
    {
        if (!isset($data["configPathPrefix"])) {
            $data["configPathPrefix"] = $this->configPathPrefix;
        }
        return $this->_objectManager->create($this->_instanceName, $data);
    }
1291302
public function create(array $data = [])
	{
		$created = $this->model->create($data);

		if( ! $created)
		{
			return new Payload(null, 'not_created');
		}

		// Cache the newly created model and tag it with table's name.
		Cache::tags($this->model->getTable())->forever($created->getKey(), $created);

		return new Payload($created, 'created');
	}
576727
protected function create(array $data)
    {
        $user = User::create([
            'name' => $data['name'],
            'email' => $data['email'],
            'password' => $data['password'],
            'last_ip' => request()->ip(),
            // Only 'user'.
            'role' => 'user',
        ]);

        return $user;
    }
1284924
public static function create(array $data)
    {
        $static = new static();

        if ($static->timestamps) {
            $data = array_merge($data, [
                'created_at' => date('Y-m-d H:i:s'),
                'updated_at' => date('Y-m-d H:i:s')
            ]);
        }

        if (!array_key_exists($static->primary_key, $data)) {
            if ($static->autoIncrement) {
                $id_value = [$static->primary_key => null];

                $data = array_merge($id_value, $data);
            } else {
                if ($static->primary_key_type == 'string') {
                    $data = array_merge([
                        $static->primary_key => ''
                    ], $data);
                }
            }
        }

        $static->setAttributes($data);

        $r = $static->save();

        if ($r == 1) {
            $static->fireEvent('oncreated');
        }

        return $static;
    }
760055
public function createUser(array $data) : User
    {
        $data['password'] = Hash::make($data['password']);
        return $this->create($data);
    }
1330376
public function create(array $data)
    {
        $user = User::create([
            'name'                  => $data['name'],
            'email'                 => $data['email'],
            'password'              => bcrypt($data['password']),
            'birthday_at'           => $data['birthday_at'],
            'locale'                => $data['locale'],
            'gender'                => $data['gender'],
            'city'                  => $data['city'],
            'about'                 => $data['about'],
            'profession'            => $data['profession'],
            'hobbies'               => $data['hobbies'],
            'homepage'              => $data['homepage'],
            'skype'                 => $data['skype'],
            'facebook'              => $data['facebook'],
            'twitter'               => $data['twitter'],
            'main_character'        => $data['main_character'],
            'main_guild'            => $data['main_guild'],
            'favorite_race'         => $data['favorite_race'],
            'favorite_spec'         => $data['favorite_spec'],
            'favorite_instance'     => $data['favorite_instance'],
            'favorite_battleground' => $data['favorite_battleground'],
        ]);

        return $user;
    }