_dataToSerialize() защищенный Метод

Returns data to be serialized.
protected _dataToSerialize ( array | string | boolean $serialize = true ) : mixed
$serialize array | string | boolean The name(s) of the view variable(s) that need(s) to be serialized. If true all available view variables will be used.
Результат mixed The data to serialize.
 /**
  * Returns data to be serialized.
  *
  * @param array|string|bool $serialize The name(s) of the view variable(s) that
  *   need(s) to be serialized. If true all available view variables will be used.
  * @return mixed The data to serialize.
  */
 protected function _dataToSerialize($serialize = true)
 {
     $data = parent::_dataToSerialize($serialize);
     $serializer = $this->getSerializer();
     $includes = $this->get('_includes');
     $manager = new Manager();
     $manager->setSerializer($serializer);
     if ($includes) {
         $manager->parseIncludes($includes);
     }
     if (is_array($data)) {
         foreach ($data as $varName => &$var) {
             $var = $this->transform($manager, $var, $varName);
         }
         unset($var);
     } else {
         $data = $this->transform($manager, $data);
     }
     return $data;
 }