__debugInfo() public méthode

This is used when you print_r() an object instance.
public __debugInfo ( ) : array
Résultat array
 /**
  * debugInfo PHP 5.6+ magic method
  *
  * @return array
  *
  */
 public function __debugInfo()
 {
     $info = parent::__debugInfo();
     $info['count'] = $this->count();
     if (count($this->data)) {
         $info['items'] = array();
         foreach ($this->data as $key => $value) {
             if (is_object($value)) {
                 if (method_exists($value, 'path')) {
                     $value = '/' . ltrim($value->path(), '/');
                 } else {
                     if ($value instanceof WireData) {
                         $_value = $value;
                         $value = $value->name;
                         if (!$value) {
                             $value = $_value->id;
                         }
                         if (!$value) {
                             $value = $_value->className();
                         }
                     } else {
                         // keep $value as it is
                     }
                 }
             }
             $info['items'][$key] = $value;
         }
     }
     if (count($this->extraData)) {
         $info['extraData'] = $this->extraData;
     }
     if (count($this->itemsAdded)) {
         $info['itemsAdded'] = $this->itemsAdded;
     }
     if (count($this->itemsRemoved)) {
         $info['itemsRemoved'] = $this->itemsRemoved;
     }
     return $info;
 }
 public function __debugInfo()
 {
     $info = parent::__debugInfo();
     foreach ($this->wire('languages') as $language) {
         $info[$language->name] = isset($this->data[$language->id]) ? $this->data[$language->id] : '';
     }
     return $info;
 }
 /**
  * debugInfo PHP 5.6+ magic method
  *
  * @return array
  *
  */
 public function __debugInfo()
 {
     $info = parent::__debugInfo();
     if (count($this->data)) {
         $info['data'] = $this->data;
     }
     return $info;
 }