@param string $name
@param string $type
@param array  $result

@return Dependency
497796
public static function create($name, $type, array $result)
    {
        list($package, $link, $children) = $result;

        return new self($name, $type, $package, $link, $children);
    }
1059045
public function object_get( $type, $name ) {

		$object = self::$post_types;

		if ( 'term' == $type ) {
			$type = 'taxonomy';
		}

		if ( 'taxonomy' == $type ) {
			$object = self::$taxonomies;
		} elseif ( 'media' == $type ) {
			$object = self::$media;
		} elseif ( 'user' == $type ) {
			$object = self::$user;
		} elseif ( 'comment' == $type ) {
			$object = self::$comment;
		}

		if ( 'pod' != $type && ! empty( $object ) && is_array( $object ) && isset( $object[ $name ] ) ) {
			$pod = $object[ $name ];
		} else {
			if ( empty( self::$current_pod_data ) || ! is_object( self::$current_pod_data ) || self::$current_pod_data['name'] != $name ) {
				self::$current_pod_data = pods_api()->load_pod( array( 'name' => $name ), false );
			}

			$pod = self::$current_pod_data;
		}

		if ( empty( $pod ) ) {
			return array();
		}

		$defaults = array(
			'name'   => 'post',
			'object' => 'post',
			'type'   => 'post_type'
		);

		$pod = array_merge( $defaults, (array) $pod );

		if ( empty( $pod['name'] ) ) {
			$pod['name'] = $pod['object'];
		} elseif ( empty( $pod['object'] ) ) {
			$pod['object'] = $pod['name'];
		}

		if ( $pod['type'] != $type ) {
			return array();
		}

		return $pod;
	}
1208710
private function recurseRelationship($method, $name, $type = 'one')
    {
        $dataset = $this->getParameters('dataset', $name);

        // Assume by default this will pass
        $result = true;

        if ($type == 'one')
        {
            $result = $this->recurseRecord($method, $name, $dataset);
        }
        else
        {
            foreach ($dataset as $index => $data)
            {
                $subresult = $this->recurseRecord($method, $name, $data, $index);

                // Relationship failures are failures
                if ( ! $subresult) $result = false;
            }
        }

        // A positive result and no errors mean action was successful
        return ($result && $this->errors->count() === 0);
    }
984566
public function renameType($type, $name)
    {
        $type->setName($name);
        $this->manager->persist($type);
        $this->manager->flush();

        return $type;
    }
960636
public function create($name, $type, array $options)
    {
        if (is_string($type)) {
            $type = $this->registry->getType($type);
        }
        if (!$type instanceof WidgetTypeInterface) {
            throw new \InvalidArgumentException('Unexpected widget type.');
        }

        $options['name'] = $name;

        $resolver = new OptionsResolver();
        $type->configureOptions($resolver);
        $options = $resolver->resolve($options);

        $widget = new Widget($name, $type);
        $type->buildWidget($widget, $options);

        return $widget;
    }
512087
public function set($name, Dependency $dependency)
    {
        $required = isset($this->dependencies[$name]) && $this->dependencies[$name]->isRequired();
        $this->dependencies[$name] = new Requirement($dependency, $required);

        return $this;
    }
812062
protected function init_dependency_type( $type ) {
		$array = [ ];
		$data  = $this->getConfigKey( $type );
		foreach ( $data as $dependency ) {
			$handle           = array_key_exists( 'handle',
				$dependency ) ? $dependency['handle'] : '';
			$array[ $handle ] = $dependency;
		}
		return $array;
	}
236502
public function add($name, $type = TextType::class, $args = [])
    {
        if ($this->getTypeClass($type) === RepeatedType::class || $type instanceof RepeatedType) {
            return $this->addRepeatedType($name, $type, $args);
        }

        $formControl = $this->getTypeObject($type, $args);

        if (!isset($args['name'])) {
            $formControl->setName($name);
        }

        if ($formControl->getLabel() === null) {
            $formControl->setLabel($formControl->getHumanName());
        }

        $this->getForm()->add($formControl);

        return $this;
    }
354573
public static function get( $type, Result $result )
    {

        switch( true ) {

            case $type === 'bool':
                return new Bool('bool');

            case $type === 'oid':
            case $type === 'int4':
            case $type === 'int8':

            # exotic from here down
            case $type === 'int2':
            case $type === 'oidvector':
                return new NullSafeCallback( $type, 'intval');

            case substr( $type, 0, 4 ) === '_int':
                return new GenericArray( $type, true );

            case $type === 'citext':
            case $type === 'text':
            case $type === 'char':
            case $type === 'name':
            # exotic from here down
            case $type === 'int2vector':
            case $type === 'pg_node_tree': # seems to be stored internally as text so pass it off
                return new NullSafeCallback( $type, 'strval');

            case $type === 'bit':
            case $type === 'varbit':
                return new NullSafeCallback( $type, 'bindec');

            case $type === 'bytea':
                return new NullSafeCallback( $type, 'pg_unescape_bytea');

            case $type === 'oid':
                return new NullSafeObjectInstantiation( $type, '\\Bond\\Entity\\Types\\Oid', [$result->db] );

            case $type === 'timestamp':
                return new NullSafeObjectInstantiation( $type, "\\Bond\\Entity\\Types\\DateTime");

            case $type === 'json':
                return new NullSafeObjectInstantiation( $type, "\\Bond\\Entity\\Types\\Json", [Json::VALIDATE_DISABLE] );

            case $type === 'inet':
                return new NullSafeObjectInstantiation( $type, "\\Bond\\Entity\\Types\\Inet");

            case $type === 'hstore':
                return new NullSafeObjectInstantiation( $type, "\\Bond\\Entity\\Types\\Hstore");

            case $type === 'interval':
                return new NullSafeObjectInstantiation( $type, "\\Bond\\Entity\\Types\\DateInterval");

            case  $type === 'tsrange':
                return new DateRange( $type );

            case $type === 'StockState':
                return new StockState( $type );

            case $type[0] === '_':
                return new GenericArray( $type, false);

            // entity dataTypes
//            case Repository::isEntity( substr( $type, 1 ) ):
//
//                return new Repository( substr( $type, 1 ) );

            // some different strategies for handling unknown types
            default:

                print_r($type);

                return new NullSafeCallback( $type, 'strval');

                /*
                return new LegacyCallback( $type, function( $value ) use ( $type ) {
                    echo "{$type} - {$value}\n";
                    return new LegacyCallback( $type, (string) $type);
                });
                */

                throw new UnknownPostgresType( "`{$type}`: You might consider expanding this switch statement." );

        }

    }
1138542
public static function pull($arr, $name, $type = null)
    {
        $ret = [];
        if ($type == self::GETTER) {
            $method = 'get' . $name;
            foreach ($arr as $elem) {
                $ret[] = $elem->$method();
            }
        } elseif ($type == self::OBJ) {
            foreach ($arr as $elem) {
                $ret[] = $elem->$name;
            }
        } else {
            foreach ($arr as $elem) {
                $ret[] = $elem[$name];
            }
        }
        return $ret;
    }
959223
protected static function init(string $type = 'string', string $key = null, string $name = null)
    {
        $instance = new static();

        $instance->key($key);
        $instance->field['type'] = $type;

        if ($name) $instance->field['name'] = $name;

        return $instance;
    }
1323235
public function set($name, XType $type)
    {
        $this->loadKeysIfNotLoaded();
        $this->namedTypes[$name] = $type;

        return $this;
    }
723141
public function argument($type, $name) {
        $argument = new Argument($type, $name);
        $this->addArgument($argument);

        return $argument;
    }
471421
public function getPackagesByName($name, $type = '')
    {
        $query = ['q' => $name];

        if ($type != '') {
            $query['type'] = $type;
        }

        return $this->makeRequest('/search.json', $query);
    }
162674
public function create($type, SourceDataFactoryInterface $dataFactory, $name)
    {
        if (is_string($type)) {
            $type = $this->typeRegistry->getType($type);
        }

        return new Source($type, $dataFactory, $name);
    }
1221850
function load_filter($type, $name)
	{
		switch ($type) {
			case 'output':
				$_params = array('plugins' => array(array($type . 'filter', $name, null, null, false)));
				require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
				smarty_core_load_plugins($_params, $this);
				break;

			case 'pre':
			case 'post':
				if (!isset($this->_plugins[$type . 'filter'][$name]))
				$this->_plugins[$type . 'filter'][$name] = false;
				break;
		}
	}
781577
protected function createResult(array &$data, $type = null) {
		if ($type === null) {
			$type = $this->getResultType();
		}

		if ($type & self::RESULT_ARRAY) {
			return $data;
		}

		if ($type & self::RESULT_OBJECT) {
			return (object) $data;
		}

		if ($type & self::RESULT_MODEL) {
			return $this->create($data);
		}

		throw new Exceptions\InvalidResultType('Nothing to do with the type #' . $type);
	}