Пример #1
0
	public function getValidator($id)
	{
		$ref = new \Nette\Reflection\Property('Nella\Validator\Validator', 'validators');
		$ref->setAccessible(TRUE);
		$validators = $ref->getValue($this);
		$ref->setAccessible(FALSE);
		return $validators[$id];
	}
Пример #2
0
	private function getServices()
	{
		$ref = new \Nette\Reflection\Property('Nette\DI\Container', 'registry');
		$ref->setAccessible(TRUE);
		$registry = $ref->getValue($this->container);
		$services = array();
		foreach ($registry as $name => $service) {
			$type = gettype($service);
			if ($service == NULL || $type == "NULL") {
				continue;
			} elseif ($type == "object") {
				$type = get_class($service);
			}
			$services[] = array(
				'name' => $name,
				'type' => $type,
				'instance' => $this->serviceDump ? $service : NULL,
			);
		}
		return $services;
	}