Пример #1
0
 private function getReferenceArrayWithMetaData(array $array)
 {
     $array = $this->modifier->modifyUsingCallback($array, 'snaks-order', function ($array) {
         ApiResult::setIndexedTagName($array, 'property');
         return $array;
     });
     $array = $this->modifier->modifyUsingCallback($array, 'snaks', function ($array) {
         foreach ($array as &$snakGroup) {
             if (is_array($snakGroup)) {
                 ApiResult::setArrayType($array, 'array');
                 ApiResult::setIndexedTagName($snakGroup, 'snak');
             }
         }
         ApiResult::setArrayType($array, 'kvp', 'id');
         ApiResult::setIndexedTagName($array, 'property');
         return $array;
     });
     return $array;
 }
 /**
  * @param array $array
  * @param string $path
  *
  * @TODO FIXME duplicated / similar code in Repo ResultBuilder
  *
  * @return array
  */
 private function getArrayWithDataTypesInGroupedSnakListAtPath(array $array, $path)
 {
     return $this->modifier->modifyUsingCallback($array, $path, $this->callbackFactory->getCallbackToAddDataTypeToSnaksGroupedByProperty($this->dataTypeLookup));
 }