Changed name of Profile entity to Hat

so as not to conflict with Profile or Profile2 module on existing sites
This commit is contained in:
naomi
2018-04-11 12:18:27 +02:00
parent 1e1bfe0ca9
commit a48e37ad39
29 changed files with 1024 additions and 116 deletions

View File

@ -0,0 +1,34 @@
<?php
namespace Drupal\zencrm\Controller;
use Drupal\Core\Controller\ControllerBase;
/**
* Class HatController.
*/
class HatController extends ControllerBase {
/**
* Hello.
*
* @return string
* Return Hello string.
*/
public function createHatForPerson($type, $person_id) {
$values = array(
'type' => $type,
'person' => $person_id
);
$node = \Drupal::entityTypeManager()
->getStorage('hat')
->create($values);
$form = \Drupal::entityTypeManager()
->getFormObject('hat', 'default')
->setEntity($node);
return \Drupal::formBuilder()->getForm($form);
}
}