public function populateColumns($columns = [])
	{
		$_columns = [];
		foreach ($columns as $key => $value)
		{
			if (is_string($value))
			{
				$value_log = explode(':', $value);
				$_columns[$key] = ['attribute' => $value_log[0]];

				if (isset($value_log[1]) && $value_log[1] !== null) {
					$_columns[$key]['format'] = $value_log[1];
				}

				if (isset($value_log[2]) && $value_log[2] !== null) {
					$_columns[$key]['header'] = $value_log[2];
				}
			} elseif (is_array($value)) {
				if (!isset($value['attribute']) && !isset($value['value'])) {
					throw new \InvalidArgumentException('Attribute or Value must be defined.');
				}
				$_columns[$key] = $value;
			}
		}

		return $_columns;
	}
public function populateColumns($columns = [])
	{
		$_columns = [];
		foreach ($columns as $key => $value)
		{
			if (is_string($value))
			{
				$value_log = explode(':', $value);
				$_columns[$key] = ['attribute' => $value_log[0]];

				if (isset($value_log[1]) && $value_log[1] !== null) {
					$_columns[$key]['format'] = $value_log[1];
				}

				if (isset($value_log[2]) && $value_log[2] !== null) {
					$_columns[$key]['header'] = $value_log[2];
				}
			} elseif (is_array($value)) {
				if (!isset($value['attribute']) && !isset($value['value'])) {
					throw new \InvalidArgumentException('Attribute or Value must be defined.');
				}
				$_columns[$key] = $value;
			}
		}

		return $_columns;
	}
public function populateColumns ( $ columns = [ ] ) { $ _columns = [ ] ; foreach ( $ columns as $ key => $ value ) { if ( is_string ( $ value ) ) { $ value_log = explode ( ':' , $ value ) ; $ _columns [ $ key ] = [ 'attribute' => $ value_log [ 0 ] ] ; if ( isset ( $ value_log [ 1 ] ) && $ value_log [ 1 ] !== null ) { $ _columns [ $ key ] [ 'format' ] = $ value_log [ 1 ] ; } if ( isset ( $ value_log [ 2 ] ) && $ value_log [ 2 ] !== null ) { $ _columns [ $ key ] [ 'header' ] = $ value_log [ 2 ] ; } } elseif ( is_array ( $ value ) ) { if ( ! isset ( $ value [ 'attribute' ] ) && ! isset ( $ value [ 'value' ] ) ) { throw new \ InvalidArgumentException ( 'Attribute or Value must be defined.' ) ; } $ _columns [ $ key ] = $ value ; } } return $ _columns ; }
Populating columns for checking the column is string or array. if is string this will be checking have a formatter or header.
@param array $columns
@throws InvalidParamException
@return multitype:multitype:array
Populating columns for checking the column is string or array . if is string this will be checking have a formatter or header .