Collection::keys PHP Method

keys() public method

Returns an array of all keys in the collection
public keys ( ) : array
return array
    public function keys()
    {
        return array_keys($this->data);
    }

Usage Example

コード例 #1
0
 public function test_getting_array_of_keys()
 {
     $coll = new Collection();
     $coll->addItem('Test Item', 1);
     $coll->addItem('Test Item', 2);
     $actual = $coll->keys();
     $expected = array(1, 2);
     $this->assertEquals($expected, $actual);
 }
All Usage Examples Of Collection::keys