Finds all nodes that are expandable by AJAX

@param array $expandable An array by reference to populate with expandable nodes.
975096
public function find_expandable(array &$expandable) {
        foreach ($this->children as &$child) {
            if ($child->display && $child->has_children() && $child->children->count() == 0) {
                $child->id = 'expandable_branch_'.$child->type.'_'.clean_param($child->key, PARAM_ALPHANUMEXT);
                $this->add_class('canexpand');
                $child->requiresajaxloading = true;
                $expandable[] = array('id' => $child->id, 'key' => $child->key, 'type' => $child->type);
            }
            $child->find_expandable($expandable);
        }
    }
595682
public function setEditable($editable = true)
    {
        foreach ($this->results as $name) {
            $this->columns->offsetGet($name)->setEditable($editable);
        }

        return $this;
    }
1374609
public function each(callable $callable)
    {
        foreach ($this->attributes as $key => $value)
        {
            if($callable($value, $key) === false)
                break;
        }

        return $this;
    }
771141
private Map<String, List<Integer>> createExpandedCustomIdIndexMapping(final boolean expandedOnly) {
		TreeItemIdNode custom = getCustomTree();
		if (custom == null) {
			return Collections.EMPTY_MAP;
		}

		Set<String> expanded = null;
		if (expandedOnly) {
			expanded = getExpandedRows();
		}

		Map<String, List<Integer>> map = new HashMap<>();
		processExpandedCustomIdIndexMapping(custom, expanded, map);
		return Collections.unmodifiableMap(map);
	}
684656
public function expandResources(array $nodes)
    {
        $dirs = [];
        $ress = [];
        $toAppend = [];

        foreach ($nodes as $node) {
            $resourceTypeName = $node->getResourceType()->getName();
            ('directory' === $resourceTypeName) ? $dirs[] = $node : $ress[] = $node;
        }

        foreach ($dirs as $dir) {
            $children = $this->getDescendants($dir);

            foreach ($children as $child) {
                if ($child->isActive() &&
                    'directory' !== $child->getResourceType()->getName()) {
                    $toAppend[] = $child;
                }
            }
        }

        $merge = array_merge($toAppend, $ress);

        return $merge;
    }
357089
public function eachFillable(Closure $closure)
    {
        /** @var FillableField $item */
        foreach ($this->items as $item) {
            if ($item->fillable) {
                $closure($item);
            }
        }
    }
572616
public static function stripTags($html, $allowable = [])
    {
        if (!is_array($allowable)) {
            $allowable = preg_split("/, */", $allowable, -1, PREG_SPLIT_NO_EMPTY);
        }

        if ($allowable) {
            return strip_tags($html, '<' . implode('><', $allowable) . '>');
        }

        return strip_tags($html);
    }
1161240
protected function buildDocumentFromArray(array $searchable)
    {
        $document = [];

        foreach ($searchable as $value) {
            $result = $this->$value;

            if ($result instanceof Collection) {
                $result = $result->toArray();
            } elseif ($result instanceof Carbon) {
                $result = $result->toDateTimeString();
            } else {
                $result = $this->$value;
            }

            $document[$value] = $result;
        }

        return $document;
    }
1313517
public static function array_all( array $result, callable $callable ) {
    foreach ( $result as $value ) {
      $check = $callable($value);
      if (!$check) {
        return $check;
      }
    }
    return true;
  }
285319
public function toArray($expandFilters = false)
    {
        $matches = $this->getFilterMatch();
        if ($expandFilters === true) {
            foreach ($matches as $index => $match) {
                $matches[$index] = $match->toArray();
            }
        }

        return array(
            'varName' => $this->getVarName(),
            'varValue' => $this->getVarValue(),
            'filterMatches' => $matches
        );
    }
1009991
protected function nodeNameAvailableBelowNode(NodeInterface $parentNode, NodeInterface $node)
    {
        return $this->contentRepositoryNodeService->nodePathAvailableForNode($parentNode->getPath() . '/' . $node->getName(), $node);
    }
223895
public static function filter(array $array, callable $callable = NULL) {
    $array = is_callable($callable) ? array_filter($array, $callable) : array_filter($array);
    foreach ($array as &$element) {
      if (is_array($element)) {
        $element = static::filter($element, $callable);
      }
    }

    return $array;
  }
859110
private function relationsFromExpand(array $relations, array $expandPrefixes)
    {
        $valid = [];
        foreach ($expandPrefixes as $prefix) {
            foreach ($relations as $relation) {
                if (StringHelper::startsWith($relation, $prefix)) {
                    $valid[] = $relation;
                }
            }
        }
        return $valid;
    }
950823
private function persistRecord(array $data, array $fillable = array(), $set)
    {
        if (!empty($fillable) && !ArrayUtils::keysExist($data, $fillable)) {
            throw new LogicException('Can not persist the entity due to fillable protection. Make sure all fillable keys exist in the entity');
        }

        $this->validateShortcutData();

        if (isset($data[$this->getPk()]) && $data[$this->getPk()]) {
            $result = $this->db->update(static::getTableName(), $data)
                               ->whereEquals($this->getPk(), $data[$this->getPk()])
                               ->execute();

            return $set === true ? $data : $result;

        } else {
            // Do not insert primary key if present
            if (array_key_exists($this->getPk(), $data)) {
                unset($data[$this->getPk()]);
            }

            // Insert a new row without PK
            $result = $this->db->insert(static::getTableName(), $data)
                               ->execute();

            if ($set === true) {
                // Append a PK in result-set now
                $data[$this->getPk()] = $this->getMaxId();
                return $data;
            } else {
                return $result;
            }
        }
    }
778985
final public function persistMany(array $collection, array $fillable = array())
    {
        foreach ($collection as $item) {
            $this->persist($item, $fillable);
        }

        return true;
    }
20100
public function search($searchable)
    {
        // Check if table name or Eloquent
        $isEloquent = is_object($searchable) && method_exists($searchable, 'getTable');

        $this->table = $isEloquent ? $searchable->getTable() : $searchable;

        return $this;
    }
1120542
protected function getAllFromProviders(callable $callable)
    {
        $values = array_filter(array_map($callable, $this->providers));
        $all = [];

        foreach ($values as $value) {
            foreach ($value as $v) {
                if (!in_array($v, $all, true)) {
                    $all[] = $v;
                }
            }
        }

        return $all;
    }