I'm trying to create a new company at org via a custom module in Drupal 8. Is there any document or code or any API that I can use for creating a new company at org via Drupal 8 custom module.
Is the company an entity in Drupal 8?
Below are the modules I'm using:
1) apigee_edge
2) apigee_m10n
Org has connected at my side.
Solved! Go to Solution.
Take a look at apigee_edge/modules/apigee_edge_teams/src/Entity/Form/TeamForm.php in save(). Or https://github.com/apigee/apigee-edge-drupal/blob/8.x-1.x/modules/apigee_edge_teams/tests/src/Functi... which also creates a team programatically.
Finally, I got the solution for the same:
$team = $team_storage->create(['name' => 'Loreum', 'displayName' => 'zzzzzyrobin','status' => 'active']);
$team->setAttribute('foo', 'bar');
// or $team->setAttributes(new \Apigee\Edge\Structure\AttributesProperty(['foo' => 'bar', 'bar' => 'baz"]);
$team->save(); -------------------------------------------------- $team = $team_storage->create(['name' => 'Loreum', 'displayName' => 'zzzzzyrobin','status' => 'active', 'attributes' => new \Apigee\Edge\Structure\AttributesProperty(['foo' => 'bar', 'bar' => 'baz"])]);
$team->save();