Create a new ...

@param array $data
An array as follows: array('field0'=>$field0, 'field1'=>$field1
);

@return boolean
772250
public function create(array $data, $databaseConnectionName = null)
  {
    if(empty($databaseConnectionName))
    {
      $databaseConnectionName = $this->databaseConnectionName;
    }

    $File = new File();
    $File->setConnection($databaseConnectionName);
    $File->fill($data)->save();

    return $File;
  }
801193
public function create(array $data = [])
    {
        $data = array_filter($data);
        if (!isset($data['name']) || !isset($data['type'])) {
            throw new \LogicException('Missing one of the mandatory field!');
        }

        if (!isset($data['value'])) {
            $data['value'] = 0;
        }

        $name = $data['name'];
        $existingSetting = $this->get($name);

        if ($existingSetting) {
            throw new \LogicException(sprintf('Setting %s already exists.', $name));
        }

        $settingClass = $this->repo->getClassName();
        /** @var Setting $setting */
        $setting = new $settingClass();

        $this->eventDispatcher->dispatch(Events::PRE_CREATE, new SettingActionEvent($name, $data, $setting));

        #TODO Introduce array populate function in Setting document instead of this foreach.
        foreach ($data as $key => $value) {
            $setting->{'set'.ucfirst($key)}($value);
        }

        $this->manager->persist($setting);
        $this->manager->commit();

        $this->eventDispatcher->dispatch(Events::POST_CREATE, new SettingActionEvent($name, $data, $setting));

        return $setting;
    }
888479
public function create($data = [])
	{
		$created = $this->model->create($data);

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

		return new Payload($created, 'created');
	}
48803
public function new($data)
    {
        $response = $this->handler->handle('POST', $data, 'new');

        return $this->make($response, false);
    }
666281
protected function create(array $data)
    {
        $admin = new Admin();

        $fields           = $this->tableFields();
        $data['password'] = bcrypt($data['password']);
        foreach ($fields as $field) {
            if (isset($data[$field])) {
                $admin->$field = $data[$field];
            }
        }

        $admin->save();
        $admin->roles()->sync(request('role_id'));
        $this->sendConfirmationNotification($admin, request('password'));

        return $admin;
    }
353973
public function create(array $data) {
    $tweet = new Tweet();

    $media = new Media();
    $media->setUrl($data['user']['profile_image_url']);

    $author = new Author();
    $author->setProfilePicture($media);
    $author->setIdentifier($data['user']['id']);
    $author->setName($data['user']['name']);
    $author->setLink('https://twitter.com/' . $data['user']['screen_name']);
    $author->setUsername($data['user']['screen_name']);

    $tweet
        ->setFollowersCount($data['user']['followers_count'])
        ->setIdentifier($data['id'])
        ->setMessage($data['full_text'])
        ->setCreatedAt(new \DateTime($data['created_at']))
        ->setAuthor($author);

    if (isset($data['retweeted_status']['full_text'])) {
      $tweet->setMessage($data['retweeted_status']['full_text']);
    }

    $this->addTweetReferences($tweet, $data);
    $this->addTweetMedias($tweet, $data);

    return $tweet;
  }
1321470
public function create(array $data)
    {
        $response = $this->request->post("boards", $data);
        return new Board($this->master, $response);
    }
1233336
public function create(array $data)
    {
        $map = [
            'create' => AuditCreateEvent::class,
            'update' => AuditUpdateEvent::class,
            'delete' => AuditDeleteEvent::class,
        ];

        if ($data['type'] !== 'delete') {
            $event = new $map[$data['type']](
                $data['transaction'],
                $data['primary_key'],
                $data['source'],
                $data['changed'],
                $data['original']
            );
        } else {
            $event = new $map[$data['type']](
                $data['transaction'],
                $data['primary_key'],
                $data['source']
            );
        }

        if (isset($data['parent_source'])) {
            $event->setParentSourceName($data['parent_source']);
        }

        $reflection = new ReflectionObject($event);
        $timestamp = $reflection->getProperty('timestamp');
        $timestamp->setAccessible(true);
        $timestamp->setValue($event, $data['@timestamp']);
        $event->setMetaInfo($data['meta']);

        return $event;
    }
1230259
public static function createFromArray(array $data)
    {
        $status = 0;
        $message = '';

        if (isset($data['status'])) {
            $status = $data['status'];
        }

        if (isset($data['message'])) {
            $message = $data['message'];
        }

        return new self($status, $message);
    }
409696
public function create(array $data)
    {
        if (array_key_exists("image", $data)) {
            if (class_exists('\CURLFile')) {
                $data["image"] = new \CURLFile($data['image']);
            } else {
                $data["image"] = '@' . $data['image'];
            }
        }

        $response = $this->request->post("pins", $data);
        return new Pin($this->master, $response);
    }
479107
public static function createFromArray(array $data)
    {
        $self = new self();

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

        return $self;
    }
469763
public function create(array $data)
    {
        $url = $this->getUrl('create');
        $request = urldecode(json_encode($data, JSON_UNESCAPED_UNICODE));
        $json = $this->curl->post($url, $request);

        return $json;
    }
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;
    }
264442
public function createOne($data)
    {
        $row = $this->getTable()::create();

        $data = $this->filterData($data);

        $row->setFromArray($data);
        return $row->save();
    }
1256490
public function create(array $data)
    {
        $data = $this->client->post(Inflector::pluralize($this->getResourceName()), [$this->getResourceName() => $data]);

        return $this->fromArray(reset($data));
    }
646519
public function create(array $data)
    {
        $response = $this->ontraport->post(
            $this->getNamespace(), $this->toArray($data)
        );

        return $this->ontraport->item($this, $response);
    }
1296036
protected function create(array $data)
    {
        return User::create([
            'name' => $data['name'],
            'email' => $data['email'],
            'password' => bcrypt($data['password']),
            'token' => $this->userRepository->createToken(),
            'active' => 1,
        ]);
    }