예제 #1
0
function employeeExample1()
{
    $employees = SampleDataLoader::getEmployees(true);
    // Assignment -- get a list of employees names
    // Get a list of employees foreach
    $names = array();
    foreach ($employees as $employee) {
        $names[] = $employee['firstName'];
    }
    print_r($names);
    // Using a sequence
    $names2 = Sequence::make($employees)->pluck('firstName')->to_a();
    print_r($names2);
}
예제 #2
0
 public function testIdentity()
 {
     $employees = SampleDataLoader::getEmployees(true);
     $copy = exampleIdentity($employees);
     $this->assertEquals($employees, $copy);
 }