Make an child item and add it to the parent item.

@param  string         $type
@param  array          $properties
@param  \Closure|null  $callback

@return self
488670
private function makeSubItem($type, array $properties = [], Closure $callback = null)
    {
        $item = self::make(array_merge($properties, compact('type')), $callback);

        $this->addChild($item);

        return $item;
    }
566258
public function on($type, $name, $callback)
    {
        $name = $type . '.' . $name;
        if (!isset($this->events[$name])) {
            $this->events[] = [];
        }

        $this->events[$name][] = $callback;
    }
1256535
public function sort(Closure $callback = null)
    {
        if ($callback) {
            usort($this->items, $callback);
        } else {
            sort($this->items);
        }
        return new static($this->items);
    }
1054079
public function process_child( $type ) {

		if ( isset( $this->struct[ $type ]['id'] ) ) {
			$this->{$type}( $this->struct[ $type ]['id'], $this->struct[ $type ] );
		} else {
			$this->process_children( $type );
		}

	}
339073
public function extend(Closure $callback = null)
    {
        !is_null($callback) && call_user_func($callback, $this->grid, $this->container->make('request'), $this->container->make('translator'));

        return $this;
    }
1061546
public function eachChild($callback)
    {
        foreach ($this->children as $child) {
            call_user_func($callback, $child);
        }

        return $this;
    }
813568
public function attachCallback($callback, $type = self::JOB_COMPLETE)
    {
        if (!is_callable($callback)) {
            throw new Exception('Invalid callback specified');
        }
        if (!isset($this->callback[$type])) {
            throw new Exception('Invalid callback type specified.');
        }
        $this->callback[$type][] = $callback;
    }
416202
public function trigger($type)
    {
        if (isset($this->callbacks[$type])) {
            foreach ($this->callbacks[$type] as $cb) {
                \pwf\helpers\SystemHelpers::call($this->prepareCallback($cb));
            }
        }
        return $this;
    }
514679
public function each($callback)
    {
        foreach ($this->_data as $key => $val) {
            $this->_data[$key] = $callback($val, $key, $this);
        }
        return $this;
    }
586783
public function attachment(Closure $callback)
    {
        $this->attachments[] = $attachment = new Attachment;

        $callback($attachment);

        return $this;
    }
59783
function(type, callback) {
        var listeners = this.__getEventListener(type);
        for (var i = 0; i < listeners.length; i++) {
            if (callback === listeners[i]) {
                listeners.splice(i--, 1);
            }
        }
        return this;
    }
675301
public function setCallback(Callable $callback, bool $force = false){

            if($force || !$this->parentCallback){
                $this->parentCallback = $callback;
            }
            
            return $this;

        }
749976
protected function addPropertyChild($propertyValue, ContextInterface $context, $last)
    {
        // If the property value is a thing and this is the element's last property
        if (($propertyValue instanceof ThingInterface) && $last) {
            // Set the thing as parent thing for nested iterations
            $context = $context->setParentThing($propertyValue);
        }

        return $context;
    }
763148
protected function setProperties(
        $type = null,
        $key = null,
        $attributes = [],
        $validKeys = []
    ) {
        if (isset($this->properties['type']) && $this->properties['type'] == $type) {
            foreach ($attributes as $attribute => $value) {
                if (in_array($attribute, $validKeys)) {
                    $this->{$key}[$attribute] = $value;
                }
            }
        }
    }
159976
public function registerFilter($type, $callback)
    {
        $this->smarty->registered_filters[$type][$this->_get_filter_name($callback)] = $callback;
    }
1045338
protected function call( $type, $params ) {
		if ( !isset( $this->callbacks[$type] ) ) {
			return;
		}
		foreach ( $this->callbacks[$type] as $callback ) {
			if ( is_callable( $callback ) ) {
				call_user_func_array( $callback, $params );
			}
		}
	}
1298197
public function attachment(Closure $callback)
    {
        $this->attachments[] = $attachment = new SlackAttachment;

        $callback($attachment);

        return $this;
    }