create.

@param array $data

@return FacebookPost $post
506663
public function create(array $data)
    {
        $from = $data['from'];

        $author = new Author();
        $author->setIdentifier($from['id']);
        $author->setName($from['name']);
        $author->setLink($from['link']);

        $media = new Media();
        $media->setUrl($from['picture']['data']['url']);
        $media->setLink($from['link']);
        $author->setProfilePicture($media);

        $data['message'] = isset($data['message']) ? $data['message'] : '';

        $post = new FacebookPost();
        $post
            ->setIdentifier($data['id'])
            ->setMessage($data['message'])
            ->setAuthor($author)
            ->setCreatedAt(new \DateTime($data['created_time']))
            ;

        if (isset($data['full_picture'])) {
            $media = new Media();
            $media->setUrl($data['full_picture']);
            $media->setLink($data['link']);
            $post->addMedia($media);
        }

        $this->addPostReferences($post, $data);

        return $post;
    }
210164
public function create(array $data)
    {
        $url = "https://api.weixin.qq.com/card/create?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, $data);
    }
317124
public function create($data)
    {
        $data = $this->retrieveData($data);
        $insertData = [
            'role_id'=> $this->getRoleId(),
            'resource' => $data['resource'],
            'methods'=> implode(',', $data['methods']),
        ];
        $this->table->insert($insertData);

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

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

		return new Payload($created, 'created');
	}
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;
    }
928262
protected function createEntry(array $data)
    {
        return Entity\AccountNode::fromNode(parent::createEntry($data), $this->getConnection()->getConfiguration());
    }
960728
public function create($data, $webhookId = null)
    {
        if (isset($webhookId)) {
            return $this->client()->put($data, 'webhooks/{webhookId}', ['webhookId' => $webhookId]);
        }

        return $this->client()->post($data, 'webhooks');
    }
69081
public static function createFromArray(array $data)
    {
        $self = new self();

        foreach ($data as $translation) {
            $self->addTranslation(Translation::createFromArray($translation));
        }

        return $self;
    }
784079
public function create(array $data = [])
    {
        $model = $this->factory($data);

        $this->save($model);

        return $model;
    }
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);
    }
863810
public function create(array $data = [])
    {
        $account = new Account();

        if (array_key_exists('avatar', $data)) {
            $account->setAvatar(
                $this->getAvatarFactory()->createCollection($data['avatar'])
            );
        }

        return $this->hydrate($account, $data);
    }
908296
public function create(array $data)
    {
        $parameters = ['name' => $data['name']];

        foreach ($data['config'] as $key => $value) {
            $parameters["config.$key"] = $value;
        }

        return $this->post('plugins/', [
            'json' => $parameters
        ]);
    }
264442
public function createOne($data)
    {
        $row = $this->getTable()::create();

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

        $row->setFromArray($data);
        return $row->save();
    }
1180202
public function create(array $data = [])
    {
        $lists = new Lists();

        if (array_key_exists('items', $data)) {
            $lists->setItems(
                $this->getListItemFactory()->createCollection($data['items'])
            );
        }

        /** Images */
        if (array_key_exists('poster_path', $data)) {
            $lists->setPosterImage($this->getImageFactory()->createFromPath($data['poster_path'], 'poster_path'));
        }

        return $this->hydrate($lists, $data);
    }
566606
protected function createPagination(array $data = null)
    {
        $pagination = new DatabasePagination();
        if ($data !== null) {
            $pagination->setData($data);
        }
        return $pagination;
    }
1103266
public static function createFromArray(array $data)
    {
        $self = new self();

        foreach ($data as $searchResult) {
            $self->addSearchResult(KeySearchResult::createFromArray($searchResult));
        }

        return $self;
    }
1208427
public function createNewRecord($data) {
        $people = new $this->model;

        $people['user_id']        = $data['user_id'];
        $people['title']          = $data['title'];
        $people['salutation']     = $data['salutation'];
        $people['first_name']     = $data['first_name'];
        $people['middle_name']    = $data['middle_name'];
        $people['surname']        = $data['surname'];
        $people['position']       = $data['position'];
        $people['description']    = $data['description'];
        $people['comments']       = $data['comments'];

        $people['birthday']       = $data['birthday'];
        $people['anniversary']    = $data['anniversary'];

        $people['created_at']     = $data['created_at'];
        $people['created_by']     = $data['created_by'];
        $people['updated_at']     = $data['updated_at'];
        $people['updated_by']     = $data['updated_by'];

        $people['profile']        = $data['profile'];
        $people['featured_image'] = $data['featured_image'];

        if ($people->save()) {

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

        return false;
    }