Skip to content

Instantly share code, notes, and snippets.

@vijaycs85
Created August 1, 2013 13:36
Show Gist options
  • Save vijaycs85/6131381 to your computer and use it in GitHub Desktop.
Save vijaycs85/6131381 to your computer and use it in GitHub Desktop.
<?php
/**
* Provides storage data of given storage key.
*
* @param $storage_key
*
* @return array
*/
public function getStorage($storage_key) {
if ($this->hasStorage($storage_key)) {
return $this->storage[$storage_key];
}
return array();
}
/**
* Checks whether given storage key has data in storage.
*
* @param $storage_key
*
* @return bool
*/
public function hasStorage($storage_key) {
return !empty($this->storage) && !empty($this->storage[$storage_key]);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment