Pattern method for fabrication-framework standardized patterns.

@param	string	$name							Object $name to instantiate.
@param	type	$attributes						Object attributes.
@param	type	$data							Object data.
@return	object	\Library\Pattern\objectName
559557
public function createPattern($name = 'html', $attributes = array(), $data = array())
    {
        $patternName = ucfirst($name);

        $objectName = 'Library\Pattern\\' . $patternName;
        $pattern = new $objectName($this, $attributes, $data);

        return $pattern;
    }
367691
public static function build($name, $type)
	{
		$factory = new BuildFactory(self::config($name), $type);
		$buildNode = $factory->build();
		$buildNode->build();
		return $buildNode->getNodes();
	}
1046358
public function dataset(string $name, string $type, $data)
    {
        if ($data instanceof Collection) {
            $data = $data->toArray();
        }

        $dataset = new $this->dataset($name, $type, $data);

        array_push($this->datasets, $dataset);

        return $dataset;
    }
1046978
public function attribute( $name )
    {
        if ( $this->hasAttribute( $name ) )
        {
            return $this->attributes[$name];
        }
        else
        {
            $value = null;
            return $value;
        }
    }
197389
public function getPattern($name = '')
    {
        if ('' === $name) {
            return $this->pattern;
        }

        return isset($this->pattern[$name]) ? $this->pattern[$name] : null;
    }
914061
public static function createFromArray($name, array $data = [])
    {
        $type = parent::createFromArray($name, $data);
        \assert($type instanceof self);
        $type->setPossibleTypes(\explode('|', $type->getType()));
        $type->setType('union');

        if (isset($data['properties'])) {
            $type->setProperties($data['properties']);
        }

        if (isset($data['additionalProperties'])) {
            $type->setAdditionalProperties($data['additionalProperties']);
        }

        return $type;
    }
1331654
public function instance($name, array $attr = [])
    {
        $model = $this->make($name, $attr, false);

        $this->triggerCallback($model, $name);

        return $model;
    }
695813
public function addField($name, array $attributes)
    {
        //Argument 1 must be a string
        Argument::i()->test(1, 'string');
        
        $this->addFields[$name] = $attributes;
        return $this;
    }
103220
public function addField($name, array $attributes)
    {
        //Argument 1 must be a string
        Argument::i()->test(1, 'string');
        
        $this->fields[$name] = $attributes;
        return $this;
    }
975241
public function custom(string $name, array $attributes): Custom
    {
        /** @var ContainerElement $this */
        return $this->addElement(Custom::factory($name, $attributes));
    }
555453
public function changeField($name, array $attributes)
    {
        //Argument 1 must be a string
        Argument::i()->test(1, 'string');
        
        $this->changeFields[$name] = $attributes;
        return $this;
    }
891675
protected function getAttribute($name)
    {
        if (isset($this->data[$name])) {
            return $this->data[$name];
        }

        return null;
    }
1167199
public function fork($name, array $data = [], array $attributes = []) {
        return new self(
            $name,
            $data,
            $attributes,
            null,
            $this->reference
        );
    }
1239666
public function getAttribute($name)
    {
        $result = null;

        if ($this->attributeExists($name)) {
            $result = $this->attributes[$name];
        }

        return $result;
    }
959076
public static function newInstance($name, $data = null)
  {
    if (!is_array($data)) {
      $data = array();
    }

    $config = self::getInstance($name);
    $config->_data = $data;

    return $config;
  }
348004
public function findAttribute($name)
    {
        foreach ($this->attributes as $attribute) {
            if ($attribute->getName() === $name) {
                return $attribute;
            }
        }

        return null;
    }
1012931
public static function attributes( $attributes, $name = null, $type = null, $options = null ) {

		$attributes = (array) apply_filters( "pods_form_ui_field_{$type}_attributes", $attributes, $name, $options );

		foreach ( $attributes as $attribute => $value ) {
			if ( null === $value ) {
				continue;
			}

			echo ' ' . esc_attr( (string) $attribute ) . '="' . esc_attr( (string) $value ) . '"';
		}
	}