FarmEntityTypeBase.php in farmOS 2.x
File
modules/core/entity/src/FarmEntityTypeBase.php
View source
<?php
namespace Drupal\farm_entity;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
use Drupal\Core\Plugin\PluginBase;
use Drupal\farm_field\FarmFieldFactoryInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
abstract class FarmEntityTypeBase extends PluginBase implements ContainerFactoryPluginInterface {
protected $farmFieldFactory;
public function __construct(array $configuration, $plugin_id, $plugin_definition, FarmFieldFactoryInterface $farm_field_factory) {
parent::__construct($configuration, $plugin_id, $plugin_definition);
$this->farmFieldFactory = $farm_field_factory;
}
public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
return new static($configuration, $plugin_id, $plugin_definition, $container
->get('farm_field.factory'));
}
}