35 $this->widgetIdentifier = $identifier;
41 $this->captionCallback = NULL;
42 $this->defaultValueFunction =
function ($name, $value) {
62 \array_splice($this->visibleProperties,
$index, 1);
63 \array_splice($this->values,
$index, 1);
64 \array_splice($this->captions,
$index, 1);
71 $count = $this->
count();
72 $hasGroupby = is_array($this->groupByFields);
79 if (array_search(
$index, $this->groupByFields) ===
false) {
92 if (isset($this->values[
"identifier"])) {
93 if (\is_string($this->values[
"identifier"]))
102 $property = $this->properties[
$index];
110 return $func($name, $value,
$index, $this->instance);
114 $property->setAccessible(
true);
115 return $property->getValue($this->instance);
120 $propertyName = $property;
121 if ($property instanceof \ReflectionProperty) {
123 $propertyName = $property->getName();
124 } elseif (\is_callable($property) && \array_search($property, [
'system',
'date']) ===
false){
126 $value = $property($this->instance);
129 elseif (\is_array($property)) {
133 $value = \implode(
'',
$values);
134 } elseif (\is_string($property)) {
136 if (isset($this->instance->{$property})) {
137 $value = $this->instance->{$property};
147 if (isset($this->values[
$index])) {
162 array_splice($this->visibleProperties,
$index, 0, [
166 array_splice($this->visibleProperties,
$index, 0, $field);
172 if (isset($this->visibleProperties[
$index])) {
173 if (is_array($this->visibleProperties[$index])) {
184 if (\is_array($vb[$index])) {
185 $this->visibleProperties[
$index][$key] = $field;
187 $this->visibleProperties[
$index] = [
193 if (\is_array($vb[$index])) {
194 $this->visibleProperties[
$index][] = $field;
196 $this->visibleProperties[
$index] = [
210 $this->visibleProperties[] = [
214 $this->visibleProperties[] = $field;
220 $this->visibleProperties = \array_merge($this->visibleProperties, $fields);
225 return \sizeof($this->properties);
229 return \sizeof($this->visibleProperties);
233 return $this->properties[
$index];
238 if ($property instanceof \ReflectionProperty) {
239 $result = $property->getName();
240 } elseif (\is_callable($property)) {
241 $result = $this->visibleProperties[
$index];
257 $this->properties = [];
259 $this->reflect = new \ReflectionClass(
$instance);
263 foreach ($this->visibleProperties as $property) {
267 }
catch (\Throwable $th){
274 if (\is_callable($property)) {
275 $this->properties[] = $property;
276 } elseif (\is_string($property)) {
279 $rProperty = $this->reflect->getProperty($property);
280 $this->properties[] = $rProperty;
281 }
catch (\Exception $e) {
283 $this->properties[] = $property;
285 } elseif (\is_int($property)) {
287 if (isset($props[$property]))
288 $this->properties[] = $props[$property];
290 $this->properties[] = $property;
292 $this->properties[] = $property;
301 if ($showable !==
false) {
302 $result[] = $property;
314 $this->values[
$index] = $callback;
319 $this->values[
"identifier"] = $callback;
332 if (isset($this->captions[
$index])) {
333 return $this->captions[
$index];
335 if ($this->properties[$index] instanceof \ReflectionProperty)
336 return $this->properties[
$index]->getName();
337 elseif (\is_callable($this->properties[$index]))
340 return $this->properties[
$index];
344 $hasGroupby = is_array($this->groupByFields);
345 $count = $this->
count();
347 if (isset($this->captions)) {
348 $captions = \array_values($this->captions);
351 for ($i = $captionsSize; $i < $count - $gbSize; $i ++) {
362 if ($hasGroupby &&
sizeof(
$captions) >= $count && ! $moreAdded) {
365 if (isset($this->captionCallback) && \is_callable($this->captionCallback)) {
373 if (isset($this->captions) ===
false)
374 $this->captions = [];
375 $this->captions[
$index] = $caption;
428 return array_filter($this->visibleProperties,
function ($item) {
429 return ! (is_array($item) || is_object($item));
458 $this->groupByFields[]=$groupByField;
462 if (is_array($this->groupByFields)) {
static startswith($hay, $needle)
static getterName($propertyName, $prefix="get")
static callMethod($object, $callback, array $values)
static removeByKeys($array, $keys)
static sortAssociative($array, $sortedKeys=array())
static swapElements(&$array, $index1, $index2)
static moveElementTo(&$array, $from, $to)