Example #1
0
 public static function remapPublicIds(array $data)
 {
     $return = [];
     foreach ($data as $key => $val) {
         if ($key === 'public_id') {
             $key = 'id';
         } elseif (strpos($key, '_id')) {
             continue;
         }
         if (is_array($val)) {
             $val = Utils::remapPublicIds($val);
         }
         $return[$key] = $val;
     }
     return $return;
 }