Sets multiple column types at once.
@param array|Traversable $types
@return Result fluent interface
510683
public function setTypes($types){
		if(!($types instanceof Traversable || is_array($types)))
			throw new InvalidArgumentException('Argument 1 must be an array or Traversable.');
		foreach($types as $column => $type){
			$this->setType($column, $type);
		}
		return $this;
	}
933073
function columns(array $columns)
    {
        foreach ($columns as &$col) {
            if (!$col instanceof Attribute) {
                $col = new UnqualifiedColumn($col);
            }
        }
        $this->nodes->columns = $columns;
        return $this;
    }
252408
public function setColumns(array $columns)
    {
        $defaultColumn = [
            'field'   => 'label',
            'label'   => 'Label',
            'attr'    => [
                'name'  => '',
                'id'    => '',
                'class' => '',
                'width' => '',
                'style' => '',
            ],
            'format'  => 'txt',
            'show'    => true,
            'sorting' => true,
            'hiding'  => true,
            'options' => false,
            'nested'  => false,
        ];

        $this->setPrependColumns();

        foreach ($columns as $key => $column) {
            $column = array_merge($defaultColumn, $column);
            $this->columns[ $key ] = $column;
        }

        $this->setAppendColumns();

        return $this;
    }
12744
public function fillByArray(array $types)
    {
        foreach ($types as $mimeType => $extensions) {
            $this->extensionsByType[$mimeType] = $extensions;
            foreach ($extensions as $extension) {
                $this->typeByExtension[$extension] = $mimeType;
            }
        }

        return $this;
    }
221337
private function prepareTypes($types)
    {
        $preparedTypes = [];

        foreach ($types as $type) {
            $preparedTypes[$type->getName()] = $type;
        }

        return $preparedTypes;
    }
303675
public function setColumns(array $columns)
    {
        foreach ($columns as $column) {
            $this->columns[] = new Request\Column($column);
        }

        return $this;
    }
248324
public function getAllProperties($types = self::FULL_HIERARCHY) {
    if ($types & self::WITH_OWN) {
      $properties = clone $this->properties;
    } else {
      $properties = new GObjectCollection(array());
    }
    
    if ($types & self::WITH_PARENTS && $this->getParent() != NULL) {
      // treat duplicates (aka: overriden properties):
      $parentTypes = $types | self::WITH_OWN;
      foreach ($this->getParent()->getAllProperties($parentTypes) as $property) {
        if (!$properties->has($property)) {
          $properties->add($property);
        }
      }
    }
    
    return $properties->toArray();
  }
242989
public function addIndex($type, ...$columns) {
        if (empty($columns)) {
            throw new \InvalidArgumentException("An index must contain at least one column.", 500);
        }

        $type = strtolower($type);

        // Look for a current index row.
        $currentIndex = null;
        foreach ($this->indexes as $i => $index) {
            if ($type !== $index['type']) {
                continue;
            }

            if ($type === Db::INDEX_PK || array_diff($index['columns'], $columns) == []) {
                $currentIndex =& $this->indexes[$i];
                break;
            }
        }

        if ($currentIndex) {
            $currentIndex['columns'] = $columns;
        } else {
            $indexDef = [
                'type' => $type,
                'columns' => $columns,
            ];
            $this->indexes[] = $indexDef;
        }

        return $this;
    }
528421
public function setTypesGroup($types, $attr = null)
    {
        if (! is_array($types))
            $types = [$types => $attr];

        foreach ($types as $type => $attrList) {
            if (! is_array($attrList))
                $attrList = [$attrList];

            foreach ($attrList as $attr)
                $this->inputType[$attr] = $type;
        }

        return $this;
    }
765034
public function setPossibleTypes(array $possibleTypes)
    {
        foreach ($possibleTypes as $type) {
            $this->possibleTypes[] = ApiDefinition::determineType(\trim($type), ['type' => \trim($type)]);
        }

        return $this;
    }
732198
protected function clear($types = [])
    {
        if (empty($types)) {
            unset($_SESSION[$this->alias]);
        } else {
            foreach ((array)$types as $type) {
                unset($_SESSION[$this->alias][$type]);
            }
        }

        return $this;
    }
1114510
public static function types(array $types)
    {
        $defined = array('boolean', 'integer', 'double', 'string');
        $diff = array_diff($types, $defined);

        if (empty($diff))
        {
            return true;
        }
        throw new dbException('Wrong types: "' . implode(', ', $diff) . '". Available "boolean, integer, double, string, array, object"');
    }
517512
public function setAllowedTypes($types)
    {
        $this->allowedTypes = [];
        $token = ' ,;';
        $type = strtok($types, $token);
        while ($type !== false) {
            $this->allowedTypes[] = $type;
            $type = strtok($token);
        }
    }
835145
public function setType($type)
    {
        foreach ($this->results as $name) {
            $this->columns->offsetGet($name)->setType($type);
        }

        return $this;
    }
57329
protected function column($type, $parameters = array())
		{
			$parameters = array_merge(compact('type'), $parameters);
			$this->columns[] = new Fluent($parameters);
			return end($this->columns);
		}
803475
public static function namesByType(array $types)
    {
        $names = array();

        foreach ($types as $type) {
            $names[] = self::nameByType($type);
        }

        return $names;
    }
929937
public static function genericSetMultiple(array $values)
    {
        $container = static::container();
        foreach ($values as $id => $value) {
            $container->{static::$setMethod}($id, $value);
        }
    }