summaryrefslogtreecommitdiffstats
path: root/core/lib/Drupal/Core/TypedData/ListInterface.php
diff options
context:
space:
mode:
authorAlex Pott2014-01-25 10:26:34 (GMT)
committerAlex Pott2014-01-25 10:26:34 (GMT)
commit19e8cf38489477f036e475dd6d463c853342ce1b (patch)
tree5ee32d761dfbfeb0e37d17a54d47e61068eb3438 /core/lib/Drupal/Core/TypedData/ListInterface.php
parent3d0c65a8f47fc13a64a17a1c4ae7c1c3655f7263 (diff)
Issue #2110467 by Berdir: Add first(), get($index) and possibly other methods to ListInterface.
Diffstat (limited to 'core/lib/Drupal/Core/TypedData/ListInterface.php')
-rw-r--r--core/lib/Drupal/Core/TypedData/ListInterface.php34
1 files changed, 34 insertions, 0 deletions
diff --git a/core/lib/Drupal/Core/TypedData/ListInterface.php b/core/lib/Drupal/Core/TypedData/ListInterface.php
index 53f5eac..3f8972b 100644
--- a/core/lib/Drupal/Core/TypedData/ListInterface.php
+++ b/core/lib/Drupal/Core/TypedData/ListInterface.php
@@ -43,4 +43,38 @@ interface ListInterface extends TypedDataInterface, \ArrayAccess, \Countable, \T
* The delta of the item which is changed.
*/
public function onChange($delta);
+
+ /**
+ * Returns the item at the specified position in this list.
+ *
+ * @param int $index
+ * Index of the item to return.
+ *
+ * @return \Drupal\Core\TypedData\TypedDataInterface
+ * The item at the specified position in this list. An empty item is created
+ * if it does not exist yet.
+ */
+ public function get($index);
+
+ /**
+ * Replaces the item at the specified position in this list.
+ *
+ * @param int $index
+ * Index of the item to replace.
+ * @param mixed
+ * Item to be stored at the specified position.
+ *
+ * @return static
+ * Returns the list.
+ */
+ public function set($index, $item);
+
+ /**
+ * Returns the first item in this list.
+ *
+ * @return \Drupal\Core\TypedData\TypedDataInterface
+ * The first item in this list.
+ */
+ public function first();
+
}