Exemplo n.º 1
0
 /**
  * @param LiteObject[] $objects
  * @param array $filter
  * @param array $exclude If set, $filter is ignored
  * @return array
  */
 public static function allToArray(array $objects, array $filter = [], array $exclude = [])
 {
     return ArrayParser::allToArray($objects, $filter, $exclude);
 }
 public function test_allToArray_WithExclude()
 {
     $data = [new TestObject_ArrayParser(['PropString' => 'str1']), new TestObject_ArrayParser(['PropString' => 'str2'])];
     $result = ArrayParser::allToArray($data, [], ['PropString']);
     $this->assertCount(2, $result);
     $this->assertEquals([$data[0]->toArray([], ['PropString']), $data[1]->toArray([], ['PropString'])], $result);
 }