Webmozart\KeyValueStore\Decorator\SortableDecorator::set PHP Method

set() public method

public set ( $key, $value )
    public function set($key, $value)
    {
        $this->flags = null;
        $this->store->set($key, $value);
    }

Usage Example

コード例 #1
0
 public function testSortCaseInsensitiveStringKeys()
 {
     if (PHP_VERSION_ID < 50400) {
         $this->markTestSkipped('SORT_FLAG_CASE not available');
     }
     $store = new SortableDecorator(new ArrayStore());
     $store->set('_Ac', 'A');
     $store->set('abc', 'F');
     $store->set('_ab', 'G');
     $store->set('ABB', 'E');
     $store->set('Bce', 'C');
     $store->set('bcd', 'D');
     $store->set('bCf', 'E');
     $store->sort(SORT_STRING | SORT_FLAG_CASE);
     $this->assertSame(array('_ab' => 'G', '_Ac' => 'A', 'ABB' => 'E', 'abc' => 'F', 'bcd' => 'D', 'Bce' => 'C', 'bCf' => 'E'), $store->getMultiple($store->keys()));
 }
All Usage Examples Of Webmozart\KeyValueStore\Decorator\SortableDecorator::set
SortableDecorator