Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / consolidation / robo / src / Common / BuilderAwareTrait.php
diff --git a/vendor/consolidation/robo/src/Common/BuilderAwareTrait.php b/vendor/consolidation/robo/src/Common/BuilderAwareTrait.php
new file mode 100644 (file)
index 0000000..915ff00
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+
+namespace Robo\Common;
+
+use Robo\Collection\CollectionBuilder;
+
+trait BuilderAwareTrait
+{
+    /**
+     * @var \Robo\Collection\CollectionBuilder
+     */
+    protected $builder;
+
+    /**
+     * @see \Robo\Contract\BuilderAwareInterface::setBuilder()
+     *
+     * @param \Robo\Collection\CollectionBuilder $builder
+     *
+     * @return $this
+     */
+    public function setBuilder(CollectionBuilder $builder)
+    {
+        $this->builder = $builder;
+
+        return $this;
+    }
+
+    /**
+     * @see \Robo\Contract\BuilderAwareInterface::getBuilder()
+     *
+     * @return \Robo\Collection\CollectionBuilder
+     */
+    public function getBuilder()
+    {
+        return $this->builder;
+    }
+
+    /**
+     * @return \Robo\Collection\CollectionBuilder
+     */
+    protected function collectionBuilder()
+    {
+        return $this->getBuilder()->newBuilder();
+    }
+}