Announcements
This site is in read only until July 22 as we migrate to a new platform; refer to this community post for more details.
Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Company creation in Drupal 8 at code level

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 Solved
0 8 592
2 ACCEPTED SOLUTIONS

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.

View solution in original post

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();

9190-solution.png

View solution in original post

8 REPLIES 8