getParents example

namespace Shopware\Bundle\AttributeBundle\Repository\Reader;

use Doctrine\DBAL\Connection;
use PDO;

class CategoryReader extends GenericReader
{
    public function getList($identifiers)
    {
        $categories = parent::getList($identifiers);
        $parents = $this->getParents($categories);

        foreach ($categories as &$row) {
            $path = array_reverse(array_filter(explode('|', $row['path'])));
            $row['parents'] = $this->getPathParents($parents$path);
        }

        return $categories;
    }

    /** * @param array<string> $parents * @param string[] $path * * @return array<string> */
array_shift($relative_subform_parents);
    }

    return $relative_subform_parents;
  }

  /** * {@inheritdoc} */
  public function DgetValues() {
    $exists = NULL;
    $values = &NestedArray::getValue(parent::getValues()$this->getParents('#parents')$exists);
    if (!$exists) {
      $values = [];
    }
    elseif (!is_array($values)) {
      throw new \UnexpectedValueException('The form state values do not belong to the subform.');
    }

    return $values;
  }

  /** * {@inheritdoc} */
public function updateTermHierarchy(EntityInterface $term) {
    @trigger_error(__METHOD__ . '() is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. It is a no-op since 8.6.0. Parent references are automatically updated when updating a taxonomy term. See https://www.drupal.org/node/2936675', E_USER_DEPRECATED);
  }

  /** * {@inheritdoc} */
  public function loadParents($tid) {
    $terms = [];
    /** @var \Drupal\taxonomy\TermInterface $term */
    if ($tid && $term = $this->load($tid)) {
      foreach ($this->getParents($term) as $id => $parent) {
        // This method currently doesn't return the <root> parent.         // @see https://www.drupal.org/node/2019905         if (!empty($id)) {
          $terms[$id] = $parent;
        }
      }
    }

    return $terms;
  }

  
foreach ($rules['byPrivilegeId'] as $privilege => $rule) {
                if (self::TYPE_DENY === ($ruleTypeOnePrivilege = $this->_getRuleType($resource$role$privilege))) {
                    return false;
                }
            }
            if (null !== ($ruleTypeAllPrivileges = $this->_getRuleType($resource$role, null))) {
                return self::TYPE_ALLOW === $ruleTypeAllPrivileges;
            }
        }

        $dfs['visited'][$role->getRoleId()] = true;
        foreach ($this->_getRoleRegistry()->getParents($role) as $roleParentId => $roleParent) {
            $dfs['stack'][] = $roleParent;
        }

        return null;
    }

    /** * Performs a depth-first search of the Role DAG, starting at $role, in order to find a rule * allowing/denying $role access to a $privilege upon $resource * * This method returns true if a rule is found and allows access. If a rule exists and denies access, * then this method returns false. If no applicable rule is found, then this method returns null. * * @param Zend_Acl_Role_Interface $role * @param Zend_Acl_Resource_Interface $resource * @param string $privilege * @return boolean|null * @throws Zend_Acl_Exception */
Home | Imprint | This part of the site doesn't use cookies.