Skip to content

Instantly share code, notes, and snippets.

@jlogsdon
Created September 16, 2010 03:38
Show Gist options
  • Save jlogsdon/581927 to your computer and use it in GitHub Desktop.
Save jlogsdon/581927 to your computer and use it in GitHub Desktop.
<?php
class Simple_Injector {
protected $_data;
public function __construct(array $inject = array()) {
if (isset($inject['data'])) {
$this->setData($inject['data']);
}
}
public function getData() {
if (empty($this->_data)) {
$this->_data = new \Data\Provider();
}
return $this->_data;
}
public function setData(\Data\Abstract $data) {
$this->_data = $data;
return $this;
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment