Loading fluent.module +6 −0 Original line number Diff line number Diff line Loading @@ -8,17 +8,23 @@ use Drupal\fluent\Fluent; /** * Implement fluent. * * @return \Drupal\fluent\Fluent * Fluent service. */ function fluent(): Fluent { return \Drupal::service('fluent.service'); } /** * Fieldable entity. * * @param mixed $entity * Fieldable entity. * * @return \Drupal\fluent\Fluent * Fluent service */ function using($entity): Fluent { return \Drupal::service('fluent.service')->using($entity); Loading src/FieldResolution.php +6 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ class FieldResolution { /** * Control the force skip. * * @var bool */ private bool $forceSkip = FALSE; Loading Loading @@ -129,7 +130,9 @@ class FieldResolution { /** * Force skip if field needs to be resolved. * * @param bool $force * The force. * * @return $this */ Loading @@ -138,6 +141,9 @@ class FieldResolution { return $this; } /** * Needs To Force Skip. */ public function needsToForceSkip(): bool { return $this->forceSkip; } Loading src/FieldResolver.php +0 −5 Original line number Diff line number Diff line Loading @@ -3,13 +3,8 @@ namespace Drupal\fluent; use Drupal\Core\Config\Entity\ConfigEntityInterface; use Drupal\Core\Field\FieldItemInterface; use Drupal\Core\Field\FieldItemListInterface; use Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem; use Drupal\Core\TypedData\Plugin\DataType\ItemList; use Drupal\Core\TypedData\PrimitiveBase; use Drupal\Core\TypedData\PrimitiveInterface; use Drupal\Core\TypedData\TypedDataInterface; use Drupal\fluent\Plugin\FluentFieldResolverManager; /** Loading src/Plugin/FluentFieldResolver/CommonField.php +6 −2 Original line number Diff line number Diff line Loading @@ -51,8 +51,9 @@ class CommonField extends FluentFieldResolverBase { if ($object instanceof FieldItemInterface) { try { $field = $object->get($fieldName); } catch (MissingDataException $e) { // @todo: Handle exception. } catch (MissingDataException $e) { // @todo Handle exception. } } Loading @@ -63,6 +64,9 @@ class CommonField extends FluentFieldResolverBase { return $field; } /** * Resolve Field Item. */ private function resolveFieldItem(ContentEntityInterface $object, string $fieldName) { // @todo refactor this code. // First try to access as a field Loading src/Plugin/FluentFieldResolver/RevisionField.php +1 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ class RevisionField extends FluentFieldResolverBase { ->getStorage($object->getFieldDefinition()->getTargetEntityTypeId()); if ($fieldControl->isMultivalued()) { // @todo: support multiple load revisions. // @todo support multiple load revisions. // see NodeStorage:12 if (!method_exists($storage, 'revisionIds')) { throw new \Exception('Don\'t support multiple revisions'); Loading Loading
fluent.module +6 −0 Original line number Diff line number Diff line Loading @@ -8,17 +8,23 @@ use Drupal\fluent\Fluent; /** * Implement fluent. * * @return \Drupal\fluent\Fluent * Fluent service. */ function fluent(): Fluent { return \Drupal::service('fluent.service'); } /** * Fieldable entity. * * @param mixed $entity * Fieldable entity. * * @return \Drupal\fluent\Fluent * Fluent service */ function using($entity): Fluent { return \Drupal::service('fluent.service')->using($entity); Loading
src/FieldResolution.php +6 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ class FieldResolution { /** * Control the force skip. * * @var bool */ private bool $forceSkip = FALSE; Loading Loading @@ -129,7 +130,9 @@ class FieldResolution { /** * Force skip if field needs to be resolved. * * @param bool $force * The force. * * @return $this */ Loading @@ -138,6 +141,9 @@ class FieldResolution { return $this; } /** * Needs To Force Skip. */ public function needsToForceSkip(): bool { return $this->forceSkip; } Loading
src/FieldResolver.php +0 −5 Original line number Diff line number Diff line Loading @@ -3,13 +3,8 @@ namespace Drupal\fluent; use Drupal\Core\Config\Entity\ConfigEntityInterface; use Drupal\Core\Field\FieldItemInterface; use Drupal\Core\Field\FieldItemListInterface; use Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem; use Drupal\Core\TypedData\Plugin\DataType\ItemList; use Drupal\Core\TypedData\PrimitiveBase; use Drupal\Core\TypedData\PrimitiveInterface; use Drupal\Core\TypedData\TypedDataInterface; use Drupal\fluent\Plugin\FluentFieldResolverManager; /** Loading
src/Plugin/FluentFieldResolver/CommonField.php +6 −2 Original line number Diff line number Diff line Loading @@ -51,8 +51,9 @@ class CommonField extends FluentFieldResolverBase { if ($object instanceof FieldItemInterface) { try { $field = $object->get($fieldName); } catch (MissingDataException $e) { // @todo: Handle exception. } catch (MissingDataException $e) { // @todo Handle exception. } } Loading @@ -63,6 +64,9 @@ class CommonField extends FluentFieldResolverBase { return $field; } /** * Resolve Field Item. */ private function resolveFieldItem(ContentEntityInterface $object, string $fieldName) { // @todo refactor this code. // First try to access as a field Loading
src/Plugin/FluentFieldResolver/RevisionField.php +1 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ class RevisionField extends FluentFieldResolverBase { ->getStorage($object->getFieldDefinition()->getTargetEntityTypeId()); if ($fieldControl->isMultivalued()) { // @todo: support multiple load revisions. // @todo support multiple load revisions. // see NodeStorage:12 if (!method_exists($storage, 'revisionIds')) { throw new \Exception('Don\'t support multiple revisions'); Loading