@param string $name
@param mixed  $data
@param string $destination
@param string $type

@return $this
350887
public function collectOnce($name, $data, $destination = DataCollection::DESTINATION_PROFILER, $type = null)
    {
        if (!in_array($name, $this->collectedKeys)) {
            $this->collectedKeys[] = $name;
            $dataCollection = new DataCollection($name, $data, $destination, $type);
            $this->data[$this->handleDataKey($name)] = $dataCollection;
        }

        return $this;
    }
1311980
public function add($name, $type)
    {
        $property = clone self::$propertyPrototype;

        $this->collection[$name] = $property->setName($name)->setRawType($type);

        return $this;
    }
781579
public function declareExchange($name, $type = AMQP_EX_TYPE_DIRECT, $flags = AMQP_DURABLE)
    {
        if (isset($this->_exchanges[$name])) {
            throw new InvalidKeyException(['declare `:exchange` exchange failed: it is exists already', 'exchange' => $name]);
        }

        try {
            $exchange = new \AMQPExchange($this->_channel);

            $exchange->setName($name);
            $exchange->setType($type);
            $exchange->setFlags($flags);

            if (!$exchange->declareExchange()) {
                throw new AmqpException(['declare `:exchange` exchange failed', 'exchange' => $name]);
            }
        } catch (\Exception $e) {
            throw new AmqpException(['declare `:exchange` exchange failed: `:error`', 'exchange' => $name, 'error' => $e->getMessage()]);
        }

        $this->_exchanges[$name] = $exchange;

        return $exchange;
    }
868989
public function AddElement($name, $data)
    {
        $this->factory->addElement($this, $name, $data);
        return $this;
    }
647447
public static function createFromArray($name, array $data = [])
    {
        $proxy = new static($name);
        $proxy->setDefinition($data);
        if (!isset($data['type'])) {
            throw new \InvalidArgumentException('Missing "type" key in $data param to determine datatype!');
        }
        if (isset($data['properties'])) {
            $proxy->properties = $data['properties'];
        }

        $proxy->setType($data['type']);
        if ($name !== $data['type']) {
            $proxy->setParent($data['type']);
        }

        return $proxy;
    }
870221
public static function data($data, $type = null)
    {
        $type === null && $type = MongoBinData::BYTE_ARRAY;

        return new MongoBinData($data, $type);
    }
704808
public static function input($name, $type = INPUT_SERVER)
    {
        //====================================================================//
        // Standard Safe Reading
        $result = filter_input($type, $name);
        if (null !== $result) {
            return $result;
        }
        //====================================================================//
        // Fallback Reading
        if ((INPUT_SERVER === $type) && isset($_SERVER[$name])) {
            return $_SERVER[$name];
        }
        if ((INPUT_GET === $type) && isset($_GET[$name])) {
            return $_GET[$name];
        }

        return null;
    }
163969
public function bind_value( string $name, $value, $data_type = false ) {
		$this->values_to_bind[ $name ] = array(
			'value'     => $value,
			'data_type' => $data_type,
		);
	}
1065711
public function setDiscriminatorColumn($name, $type = 'string', $length = 255)
    {
        $this->cm->setDiscriminatorColumn(array(
            'name' => $name,
            'type' => $type,
            'length' => $length,
        ));

        return $this;
    }
203495
protected function setParam(array $data, $name, $required = true, $type = 'string')
    {
        if (!isset($data[$name]) || ($required && gettype($data[$name]) !== $type)) {
            throw new Exception\DomainException(
                sprintf(
                    '%s expects the annotation %s parameter to define a %s; received "%s"',
                    get_class($this),
                    $name,
                    $type,
                    gettype($data[$name])
                )
            );
        }

        $this->$name = $data[$name];
    }
363409
public function copy($source, $destination)  
    {
        Eden_Array_Argument::i()
            //argument 1 must be a string
            ->test(1, 'string')  
            //argument 2 must be a string
            ->test(2, 'string'); 

        $this->data[$destination] = $this->data[$source];
        return $this;
    }
344323
protected function recurse(&$data, $name = null, $type = null)
    {
        if (is_scalar($data)) {
            $this->makeScalarDefinition($data, $name, $type);

            return;
        }

        if ($this->maxDepth > 0 && $this->depth >= $this->maxDepth) {
            $this->out[] = "{$this->makeDefinition($type, null, $name)} " .
            "<em style='color:#999;'>... depth limit reached</em>";

            return;
        }

        if ($this->isCircularReference($data)) {
            $this->out[] = "{$this->makeDefinition($type, null, $name)} " .
            "<em style='color:#999;'>... cirular reference omitted</em>";

            return;
        }

        $this->registerObject($data);

        $iterable = $data;
        $lpad     = str_repeat($this->indentWith, $this->depth);

        if (is_array($iterable)) {
            $len  = count($iterable);
            $type = $type ? : 'array';

            $this->out[] = "{$this->makeDefinition($type, $len, $name)} {";

            $this->depth++;

            foreach ($iterable as $key => $val) {
                $valType = gettype($val);
                if ($val instanceof EntityInterface) {
                    $valType = $val->calledClassName();
                }
                elseif (is_object($val)) {
                    $valType = get_class($val);
                }

                $this->recurse($val, $key, $valType);
            }

            $this->depth--;

            $this->out[] = "{$lpad}}";
        }
        elseif (is_object($iterable)) {
            $len  = count($iterable);
            $type = $type ? : get_class($iterable);
            
            if (!($iterable instanceof Traversable)) {
                $iterable = get_object_vars($data);
            }

            $this->out[] = "{$this->makeDefinition($type, $len, $name)} {";

            $this->depth++;

            foreach ($iterable as $key => $val) {
                if (!isset($iterable->$key) && !isset($iterable[$key])) {
                    continue;
                }

                $valType = $iterable instanceof EntityInterface ? $iterable->typeof($key) : null;
                $this->recurse($val, $key, $valType);
            }

            $this->depth--;

            $this->out[] = "{$lpad}}";
        }

        $this->deregisterObject($data);
    }
246959
public function exportFileAction($type, $name)
    {
        $server = $this->ldap->get($name);
        $server['userPassword'] = 'userpassword';
        $user = isset($server['user']) ? $server['user'] : null;
        $password = isset($server['password']) ? $server['password'] : null;

        if ($this->ldap->userMapping($server) && $this->ldap->connect($server, $user, $password)) {
            $users = $this->ldap->getUsers($server);
            $this->ldap->close();
            $response = new response(
                $this->templating->render(
                    'ClarolineAuthenticationBundle:export:'.$type.'.html.twig',
                    ['users' => $users, 'server' => $server]
                )
            );
        } else {
            $response = new Response('Error');
        }

        $response->headers->set('Content-Transfer-Encoding', 'octet-stream');
        $response->headers->set('Content-Type', 'application/force-download');
        $response->headers->set('Content-Disposition', 'attachment; filename='.$name.'.'.$type);
        $response->headers->set('Connection', 'close');

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

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

    return $config;
  }
128275
public function embedData($data, $name, $contentType = null)
    {
        $embed = $this->createEmbedViaData($data, $name, $contentType);

        return $this->getSwiftMessage()->embed($embed);
    }
528391
public function export( $data = null, $type = null, $delimiter = null ) {

		if ( ! empty( $data ) ) {
			$this->set_data( $data );
		}

		if ( ! empty( $type ) && in_array( $type, $this->types, true ) ) {
			$this->type = $type;
		}

		if ( ! empty( $delimiter ) ) {
			$this->delimiter = $delimiter;
		}

		if ( method_exists( $this, "build_{$this->type}" ) ) {
			call_user_func( array( $this, 'build_' . $this->type ) );
		}

		return $this->built;
	}
715213
public function set($name, array $data = [])
    {
        $this->setName($name);
        $this->setData($data);

        return $this->isValid();
    }