Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / vendor / consolidation / robo / src / Common / BuilderAwareTrait.php
1 <?php
2
3 namespace Robo\Common;
4
5 use Robo\Collection\CollectionBuilder;
6
7 trait BuilderAwareTrait
8 {
9     /**
10      * @var \Robo\Collection\CollectionBuilder
11      */
12     protected $builder;
13
14     /**
15      * @see \Robo\Contract\BuilderAwareInterface::setBuilder()
16      *
17      * @param \Robo\Collection\CollectionBuilder $builder
18      *
19      * @return $this
20      */
21     public function setBuilder(CollectionBuilder $builder)
22     {
23         $this->builder = $builder;
24
25         return $this;
26     }
27
28     /**
29      * @see \Robo\Contract\BuilderAwareInterface::getBuilder()
30      *
31      * @return \Robo\Collection\CollectionBuilder
32      */
33     public function getBuilder()
34     {
35         return $this->builder;
36     }
37
38     /**
39      * @return \Robo\Collection\CollectionBuilder
40      */
41     protected function collectionBuilder()
42     {
43         return $this->getBuilder()->newBuilder();
44     }
45 }