EntityCollectorBlock.php in Relation 8
File
relation_entity_collector/src/Plugin/Block/EntityCollectorBlock.php
View source
<?php
namespace Drupal\relation_entity_collector\Plugin\Block;
use Drupal\Core\Session\AccountInterface;
use Drupal\Core\Block\BlockBase;
class EntityCollectorBlock extends BlockBase {
protected function blockAccess(AccountInterface $account) {
return $account
->hasPermission('administer relations') || $account
->hasPermission('create relations');
}
public function build() {
return \Drupal::formBuilder()
->getForm('Drupal\\relation_entity_collector\\Form\\EntityCollector');
}
}