entity_generic-8.x-3.x-dev/src/GenericManagerInterface.php
src/GenericManagerInterface.php
<?php
namespace Drupal\entity_generic;
use Drupal\Core\Session\AccountInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
* Provides an interface defining an entity manager.
*/
interface GenericManagerInterface {
/**
* Instantiates a new instance of this entity handler.
*
* @param \Symfony\Component\DependencyInjection\ContainerInterface $container
* The service container this object should use.
*
* @return static
* A new instance of the entity handler.
*/
public static function create(ContainerInterface $container);
/**
* Returns the list of all entities.
*
* @return array
* Entities list.
*/
public function getAll();
/**
* Returns the list of available entities for specific user.
*
* @param \Drupal\Core\Session\AccountInterface $user
* User object.
*
* @return array
* Entities list.
*/
public function getAvailable(AccountInterface $user);
/**
* Returns the list of entities as options for select box.
*
* Only returns entities available for specific user.
*
* @param \Drupal\Core\Session\AccountInterface $user
* User object.
*
* @return array
* Options list.
*/
public function getAvailableOptions(AccountInterface $user);
/**
* Returns the list of entities as options for select box with UUIDs as keys.
*
* Only returns available entities for specific user.
*
* @param \Drupal\Core\Session\AccountInterface $user
* User object.
*
* @return array
* Options list.
*/
public function getAvailableOptionsUuid(AccountInterface $user);
/**
* Returns the set of entities by field value.
*
* @param string $field_name
* Field name.
* @param mixed $field_value
* Field value.
*
* @return array|bool
* Array of entities, FALSE otherwise.
*/
public function getByField($field_name, $field_value);
}
