get_notes() публичный Метод

Get the parsed notes for a customer as an array.
С версии: 1.0
public get_notes ( integer $length = 20, integer $paged = 1 ) : array
$length integer The number of notes to get.
$paged integer What note to start at.
Результат array The notes requested.
Пример #1
0
 public function test_customer_notes()
 {
     $customer = new Give_Customer('*****@*****.**');
     $this->assertInternalType('array', $customer->notes);
     $this->assertEquals(0, $customer->get_notes_count());
     $note_1 = $customer->add_note('Testing');
     $this->assertEquals(0, array_search($note_1, $customer->notes));
     $this->assertEquals(1, $customer->get_notes_count());
     $note_2 = $customer->add_note('Test 2nd Note');
     $this->assertEquals(1, array_search($note_1, $customer->notes));
     $this->assertEquals(0, array_search($note_2, $customer->notes));
     $this->assertEquals(2, $customer->get_notes_count());
     // Verify we took out all empty rows
     $this->assertEquals(count($customer->notes), count(array_values($customer->notes)));
     // Test 1 note per page, page 1
     $newest_note = $customer->get_notes(1);
     $this->assertEquals(1, count($newest_note));
     $this->assertEquals($newest_note[0], $note_2);
     // Test 1 note per page, page 2
     $second_note = $customer->get_notes(1, 2);
     $this->assertEquals(1, count($second_note));
     $this->assertEquals($second_note[0], $note_1);
 }