Skip to content
Snippets Groups Projects

Very basic way to add arity keys to ResourceObjectData result

Closes #3275497

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
69 69 */
70 70 protected $language;
71 71
72 /**
73 * The resource object's metadata.
74 *
75 * @var array
76 */
77 protected $meta;
  • 101 110 // entity system
    102 111 // @see \Drupal\Core\Entity\EntityBase::language()
    103 112 $this->language = $language ?: new Language(['id' => LanguageInterface::LANGCODE_NOT_SPECIFIED]);
    113 $this->meta = $meta;
    114 }
    115
    116 /**
    117 * Returns a copy of the given ResourceObject with the given arity.
    118 *
    119 * @param int $arity
    120 * The new arity; must be a non-negative integer.
  • 119 * @param int $arity
    120 * The new arity; must be a non-negative integer.
    121 *
    122 * @return static
    123 * A newly created ResourceObject with the given arity, otherwise
    124 * the same.
    125 */
    126 public function withArity(int $arity): ResourceObject {
    127 if ($this->resourceType->isVersionable()) {
    128 $versionIdentifier = str_replace('id:', '', $this->getVersionIdentifier());
    129 }
    130 else {
    131 $versionIdentifier = NULL;
    132 }
    133
    134 return new static(
  • 91 91 'links' => [
    92 92 'self' => ['href' => $self_url],
    93 93 ],
    94 'meta' => [
  • added 1 commit

    • 5bf9f42f - Apply 1 suggestion(s) to 1 file(s)

    Compare with previous version

  • Pierre Rudloff added 599 commits

    added 599 commits

    Compare with previous version

  • Pierre Rudloff added 28 commits

    added 28 commits

    Compare with previous version

  • Pierre Rudloff added 1 commit

    added 1 commit

    Compare with previous version

  • Pierre Rudloff added 1 commit

    added 1 commit

    Compare with previous version

  • Pierre Rudloff added 269 commits

    added 269 commits

    Compare with previous version

  • Please register or sign in to reply
    Loading