LFT
  • Namespace
  • Class
  • Tree

Namespaces

  • Docoflow
    • Contracts
    • Entity
    • Facades
    • Models
    • Traits
  • Docolight
    • Agno
      • Traits
    • Container
    • Http
      • Contracts
    • Rest
      • Handler
      • Http
    • Support
      • Debug
      • Traits
  • Docotory
    • Traits
  • None

Classes

  • Docoflow\Docoflow
  • Docoflow\Entity\Group
  • Docoflow\Entity\Step
  • Docoflow\Entity\Verificator
  • Docoflow\Facades\Action
  • Docoflow\Facades\Activity
  • Docoflow\Facades\Flo
  • Docoflow\Facades\StateActivity
  • Docoflow\Flo
  • Docoflow\Models\Workflow
  • Docoflow\Models\WorkflowAction
  • Docoflow\Models\WorkflowActivity
  • Docoflow\Models\WorkflowGroups
  • Docoflow\Models\WorkflowNotification
  • Docoflow\Models\WorkflowState
  • Docoflow\Models\WorkflowStateActivity
  • Docoflow\Models\WorkflowStep
  • Docoflow\Models\WorkflowVerificator
  • Docolight
  • Docolight\Agno\AgnoModule
  • Docolight\Container\Container
  • Docolight\Http\Headers
  • Docolight\Http\JsonResponse
  • Docolight\Http\MimeResponse
  • Docolight\Http\Response
  • Docolight\Http\ResponseFactory
  • Docolight\Rest\Handler\RestfulErrorHandler
  • Docolight\Rest\Http\RestFulController
  • Docolight\Support\ActiveRecordWrapper
  • Docolight\Support\Arr
  • Docolight\Support\Carbonate
  • Docolight\Support\ClassLoader
  • Docolight\Support\Collection
  • Docolight\Support\CollectionDataProvider
  • Docolight\Support\Debug\Dumper
  • Docolight\Support\Debug\HtmlDumper
  • Docolight\Support\Facade
  • Docolight\Support\Factory
  • Docolight\Support\Fluent
  • Docolight\Support\Html
  • Docolight\Support\IterablePager
  • Docolight\Support\Repository
  • Docolight\Support\Set
  • Docolight\Support\Str
  • Docotory\Factory

Interfaces

  • Docoflow\Contracts\DocoflowContract
  • Docoflow\Contracts\ValidationStatus
  • Docolight\Http\Contracts\Arrayable

Traits

  • Docoflow\Traits\BulkValidator
  • Docoflow\Traits\Entity
  • Docoflow\Traits\HasMutator
  • Docoflow\Traits\Validable
  • Docolight\Agno\Traits\HasAssetsUrl
  • Docolight\Agno\Traits\HasAutoload
  • Docolight\Support\Traits\Macroable
  • Docotory\Traits\HasFactories

Exceptions

  • Docolight\Container\BindingResolutionException
  • Docotory\ResolvingTypeException

Functions

  • array_add
  • array_build
  • array_collapse
  • array_divide
  • array_dot
  • array_except
  • array_first
  • array_flatten
  • array_forget
  • array_get
  • array_has
  • array_last
  • array_only
  • array_pluck
  • array_pull
  • array_replace_value
  • array_set
  • array_sort
  • array_sort_recursive
  • array_where
  • cache
  • camel_case
  • class_basename
  • class_uses_recursive
  • collect
  • container
  • data_get
  • dd
  • def
  • dump
  • e
  • ends_with
  • fluent
  • get
  • head
  • input
  • last
  • object_get
  • preg_replace_sub
  • request
  • response
  • session
  • snake_case
  • starts_with
  • str_contains
  • str_finish
  • str_is
  • str_limit
  • str_random
  • str_replace_array
  • str_slug
  • studly_case
  • title_case
  • trait_uses_recursive
  • transaction
  • trimtolower
  • value
  • with
 1 <?php
 2 
 3 namespace Docoflow\Entity;
 4 
 5 use Exception;
 6 use Docoflow\Traits\Entity;
 7 use Docolight\Support\Collection;
 8 use Docoflow\Traits\BulkValidator;
 9 
10 /**
11  * Step entities.
12  *
13  * @author Krisan Alfa Timur <krisanalfa@docotel.co.id>
14  */
15 class Step extends Collection
16 {
17     use Entity, BulkValidator;
18 
19     /**
20      * Group entities. Useful to determine a verificator group.
21      *
22      * @var \Docoflow\Entity\Group.
23      */
24     protected $groups;
25 
26     /**
27      * Rebuild a barely new step to a readable array.
28      *
29      * @return \Docoflow\Entity\Step
30      */
31     public function rebuild()
32     {
33         $steps = new static();
34 
35         foreach ($this as $step) {
36             $step = fluent($step);
37 
38             if (! $stepId = $step->{'$id'}) {
39                 throw new Exception("Step doesn't have an id.");
40             }
41 
42             $steps[$stepId] = $step;
43             $steps[$stepId]->groups = new Group();
44         }
45 
46         return $steps;
47     }
48 
49     /**
50      * Push group to existing implemetation, so we can determine verificator group later.
51      *
52      * @param int   $groupId
53      * @param array $group
54      *
55      * @return void
56      */
57     public function pushGroup($groupId, $group)
58     {
59         if (! $this->groups) {
60             $this->groups = new Group;
61         }
62 
63         $this->groups->offsetSet($groupId, $group);
64     }
65 
66     /**
67      * Determine whether group is exist.
68      *
69      * @param id $groupId
70      *
71      * @return boolean
72      */
73     public function hasGroup($groupId)
74     {
75         return ($this->groups instanceof Group) ? $this->groups->has($groupId) : false;
76     }
77 
78     /**
79      * Get group determine by it's id.
80      *
81      * @param int $groupId
82      *
83      * @return null|array
84      */
85     public function getGroup($groupId)
86     {
87         return ($this->groups instanceof Group) ? $this->groups->offsetGet($groupId) : null;
88     }
89 }
90 
LFT API documentation generated by ApiGen