Get all of posible transitions.

@param StatableInterface $object
@param string $objectIdentifier

@return array|null

@throws \SM\SMException
1022
public function getPosibleTransitions(StatableInterface $object =  null, $objectIdentifier = 'id')
    {
        if (empty($object)) {
            return;
        }

        $sm = $this->factory->get($object, $object->getStateGraph());

        if (empty($sm)) {
            return;
        }

        $tasks = array();
        $accessor = PropertyAccess::createPropertyAccessor();

        foreach ($object->getStateTransitions() as $transition) {
            if ($sm->can($transition)) {

                $color = $this->getTransitionColor($transition);
                $tasks[] = array(
                    'id' => $accessor->getValue($object, $objectIdentifier),
                    'name' => $transition,
                    'color' => $color,
                    'graph' => $object->getStateGraph(),
                    'label' => $this->getTransition($transition),
                    'negative' => $this->isNegativeColor($color, 'transition'),
                    'positive' => $this->isPositiveColor($color, 'transition'),
                );
            }
        }

        return empty($tasks) ? null : $tasks;
    }
361628
public function getPermissions($objectIdentity, $sid)
    {
        $objectIdentity = $this->getClassScopeObjectIdentity($objectIdentity);
        $exceptedClass = [
            'BackBee\NestedNode\MediaFolder'
        ];

        try{

            $ace = $this->getObjectAce($objectIdentity, $sid);
        }
        catch (\Exception $e){

            if(in_array($objectIdentity->getType(), $exceptedClass)) return [];

            try {

                $ace = $this->getClassAce($this->getClassScopeObjectIdentity($objectIdentity->getType()), $sid);
            }
            catch (\Exception $e){

                $parentClass = get_parent_class($objectIdentity->getType());

                if (false !== $parentClass) {

                    return $this->getPermissions($parentClass, $sid);
                }
                else{
                    return [];
                }
            }
        }

        return $this->getAccessGranted($ace);
    }
351221
public function with(ObjectInterface $object): self
    {
        $clone = clone $this;
        $clone->objects[$object->getId()] = $object;
        $clone->array[$object->getId()] = $object->getInstance();

        return $clone;
    }
897689
public function findObject($identifier, $data, $filter)
    {
        if ($objects = $this->findObjects($identifier, $data, $filter)) {
            
            if ($objects->exists()) {
                return $objects->first();
            }
            
        }
    }
259898
public function equals(ObjectIdentifiableInterface $identity)
    {
        return ($this->getType() === $identity->getType() && $this->getIdentifier() === $identity->getIdentifier());
    }
661814
public function populateIdentifier(DataObject $object, $identifier)
    {
        if ($field = $this->getDefaultIdentifier()) {
            
            return $object->setField($field, $identifier);
            
        } else {
            
            if ($this->getSchema()->fieldSpec($object, 'Title')) {
                return $object->setField('Title', $this->getIdentifierAsTitle($identifier));
            }
            
            if ($this->getSchema()->fieldSpec($object, 'Name')) {
                return $object->setField('Name', $this->getIdentifierAsTitle($identifier));
            }
            
        }
        
        return $object;
    }
12448
public function readScopeIdentifiers(int $identifier): array
    {
        try {
            $schema = $this->getDatabaseSchema();
            return $this->readBelongsToManyRelationshipIdentifiers(
                $identifier,
                $schema->getTokensScopesTable(),
                $schema->getTokensScopesTokenIdentityColumn(),
                $schema->getTokensScopesScopeIdentityColumn()
            );
        } catch (RepositoryException $exception) {
            $message = 'Reading scopes for a token failed.';
            throw new RepositoryException($message, 0, $exception);
        }
    }
732470
protected function convertIdentifierToObjects(array $identifiers)
    {
        $idName = DomainUtil::getIdentifierName($this->om, $this->getClass());
        $objects = [];
        $missingIds = [];
        $searchIds = DomainUtil::extractIdentifierInObjectList($identifiers, $objects);

        if (\count($searchIds) > 0) {
            $previousFilters = $this->disableFilters();
            $searchObjects = $this->getRepository()->findBy([$idName => $searchIds]);
            $this->enableFilters($previousFilters);
            $objects = array_merge($objects, $searchObjects);

            if (\count($searchIds) !== \count($searchObjects)) {
                $missingIds = $searchIds;

                foreach ($objects as $object) {
                    $pos = array_search(DomainUtil::getIdentifier($this->om, $object), $missingIds, true);

                    if (false !== $pos) {
                        array_splice($missingIds, $pos, 1);
                    }
                }
            }
        }

        return [$objects, $missingIds];
    }
929972
public function initialize($object)
    {
        foreach ($this->initializers as $interface => $initializer) {
            if ($object instanceof $interface) {
                $initializer($object, $this);
            }
        }

        if ($object instanceof ShutdownInterface) {
            $this->shutdownServices [] = $object;
        }

        return $object;
    }
876824
public function get(string $entryIdentifier)
    {
        $value = $this->memcache->get($this->identifierPrefix . $entryIdentifier);
        if (substr($value, 0, 13) === 'Flow*chunked:') {
            list(, $chunkCount) = explode(':', $value);
            $value = '';
            for ($chunkNumber = 1; $chunkNumber < $chunkCount; $chunkNumber++) {
                $value .= $this->memcache->get($this->identifierPrefix . $entryIdentifier . '_chunk_' . $chunkNumber);
            }
        }
        return $value;
    }
67456
public function get(string $entryIdentifier)
    {
        $success = false;
        $value = apcu_fetch($this->identifierPrefix . 'entry_' . $entryIdentifier, $success);
        return ($success ? $value : $success);
    }
196580
protected function fetchData( $identifier, $object = false )
    {
        $data = $this->backend->fetch( $identifier );
        if ( is_object( $data ) && $object === false )
        {
            return $data->data;
        }
        if ( is_object( $data ) && $object !== false )
        {
            return $data;
        }
        else
        {
            return false;
        }
    }
173553
public function getElementByIdentifier($elementIdentifier)
    {
        return isset($this->elementsByIdentifier[$elementIdentifier]) ? $this->elementsByIdentifier[$elementIdentifier] : null;
    }
609308
public function readInterface($object = null) {
        $properties = new Map();

        if ($this->class->getConstructor()) {
            foreach ($this->class->getConstructor()->getParameters() as $parameter) {
                $this->accumulate($properties,
                    new property\ConstructorProperty($this->factory, $this->class->getConstructor(), $parameter));
            }
        }

        $declaredProperties = array();
        foreach ($this->class->getProperties(\ReflectionProperty::IS_PUBLIC) as $property) {
            if (!$property->isStatic()) {
                $declaredProperties[] = $property->name;
                $this->accumulate($properties,
                    new property\InstanceVariableProperty($this->factory, $property));
            }
        }

        if (is_object($object)) {
            foreach ($object as $name => $value) {
                if (!in_array($name, $declaredProperties)) {
                    $this->accumulate($properties,
                        new property\DynamicProperty($this->factory, new \ReflectionClass($object), $name));
                }
            }
        }

        foreach ($this->class->getMethods(\ReflectionMethod::IS_PUBLIC) as $method) {
            if (property\AccessorProperty::isAccessor($method) && !$method->isStatic()) {
                $this->accumulate($properties,
                    new property\AccessorProperty($this->factory, $method));
            }
        }

        return $properties;
    }
981450
private function processSerializeTypeIdentifiedObject(
        Type\IdentifiedObject $objectType,
        $object,
        array $data,
        string $attribute
    ): array {
        return $this->setArrayAndCheckNull($data, $object->{$objectType->getter()}(), $attribute);
    }
927234
protected function getIdentifierFromObject($object)
    {
        $class = get_class($object);
        $meta = $this->entityMetadataFactory->getMetadataFor($class);
        $values = $meta->getIdentifierValues($object);

        $values = array_map(
            function ($value) {
                if (is_object($value)) {
                    return $this->getIdentifierFromObject($value);
                }

                return $value;
            },
            $values
        );

        return $values;
    }
88102
private function findObjectIdentityId(ObjectIdentityInterface $objectIdentity)
    {
        if ($this->objectIds->contains($objectIdentity)) {
            return $this->objectIds->offsetGet($objectIdentity);
        }

        $conn = $this->getConnection();

        $qb = $conn->createQueryBuilder();
        $qb
            ->select('id')
            ->from('acl_object_identity')
            ->where($qb->expr()->eq('type', $qb->expr()->literal($objectIdentity->getType())))
            ->andWhere($qb->expr()->eq('identifier', $qb->expr()->literal($objectIdentity->getIdentifier())));

        $id = $qb->execute()->fetchColumn();

        if ($id) {
            $this->objectIds->attach($objectIdentity, $id);
        }

        return $id;
    }