| 1 | <?php |
||
| 8 | trait Queueable |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var Buildable[] |
||
| 12 | */ |
||
| 13 | protected $queued = []; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @param Buildable $buildable |
||
| 17 | */ |
||
| 18 | 180 | protected function queue(Buildable $buildable) |
|
| 22 | |||
| 23 | /** |
||
| 24 | * @param Buildable $buildable |
||
| 25 | * @param callable|null $callback |
||
| 26 | */ |
||
| 27 | 118 | public function callbackAndQueue(Buildable $buildable, callable $callback = null) |
|
| 33 | |||
| 34 | /** |
||
| 35 | * Execute the build process for all queued buildables |
||
| 36 | */ |
||
| 37 | 256 | public function build() |
|
| 50 | |||
| 51 | /** |
||
| 52 | * @return \LaravelDoctrine\Fluent\Buildable[] |
||
| 53 | */ |
||
| 54 | 290 | public function getQueued() |
|
| 58 | |||
| 59 | /** |
||
| 60 | * Call the callable... only if it is really one. |
||
| 61 | * |
||
| 62 | * @param callable|null $callback |
||
| 63 | * @param mixed $builder |
||
| 64 | * |
||
| 65 | * @return void |
||
| 66 | */ |
||
| 67 | 124 | protected function callIfCallable($callback, $builder) |
|
| 73 | } |
||
| 74 |