Пример #1
0
 /**
  * @see \Ableron\Lib\Storage\AbstractStorage::performDelete()
  */
 protected function performDelete(string $storageKey)
 {
     // delete storage item if exists
     $this->arrayStorage->removeByKey($storageKey);
     // indicate that storage item has been deleted successfully
     return true;
 }
Пример #2
0
 /**
  * @see \Ableron\Core\Form\FormElementInterface::removeLabelAttribute()
  */
 public function removeLabelAttribute($attributeName)
 {
     $this->labelAttributes->removeByKey($attributeName);
     return $this;
 }
Пример #3
0
 /**
  * Tests whether removeByKey() works as expected with non-existing key.
  *
  * @return void
  */
 public function testRemoveByKeyWithNonExistingKey()
 {
     $map = new OrderedMap(array('foo' => 'bar', 'bar' => 'bar', 'baz' => 'bar', 'foobar' => 'foobarbaz'));
     $this->assertSame(array('foo' => 'bar', 'bar' => 'bar', 'baz' => 'bar', 'foobar' => 'foobarbaz'), $map->toArray());
     $map->removeByKey('123');
     $this->assertSame(array('foo' => 'bar', 'bar' => 'bar', 'baz' => 'bar', 'foobar' => 'foobarbaz'), $map->toArray());
 }