protected function _getAssociationsList($entity, array $associationTypes = [])
    {
        $table = $this->_controller()->loadModel();
        $associations = $table->associations();

        $result = [];
        foreach ($associations as $association) {
            $associationType = $association->type();

            if (empty($associationTypes)) {
                array_push($result, $association->getName());
                continue;
            }

            if (in_array($association->type(), $associationTypes)) {
                array_push($result, $association->getName());
            }
        }

        return $result;
    }
protected function _getAssociationsList($entity, array $associationTypes = [])
    {
        $table = $this->_controller()->loadModel();
        $associations = $table->associations();

        $result = [];
        foreach ($associations as $association) {
            $associationType = $association->type();

            if (empty($associationTypes)) {
                array_push($result, $association->getName());
                continue;
            }

            if (in_array($association->type(), $associationTypes)) {
                array_push($result, $association->getName());
            }
        }

        return $result;
    }
protected function _getAssociationsList ( $ entity , array $ associationTypes = [ ] ) { $ table = $ this -> _controller ( ) -> loadModel ( ) ; $ associations = $ table -> associations ( ) ; $ result = [ ] ; foreach ( $ associations as $ association ) { $ associationType = $ association -> type ( ) ; if ( empty ( $ associationTypes ) ) { array_push ( $ result , $ association -> getName ( ) ) ; continue ; } if ( in_array ( $ association -> type ( ) , $ associationTypes ) ) { array_push ( $ result , $ association -> getName ( ) ) ; } } return $ result ; }
Returns a flat array list with the names of all associations for the given
entity, optionally limited to only matching associationTypes.

@param \Cake\ORM\Entity $entity Entity
@param array $associationTypes Array with any combination of Cake\ORM\Association types
@return array
Returns a flat array list with the names of all associations for the given entity optionally limited to only matching associationTypes .