protected function protect() { $reflector = new \ReflectionClass($this); foreach ($reflector->getMethods() as $method) { if (!preg_match('#^(__).+#', $method->name) and !$method->isprotected()) { throw new \Exception(ErrorMessage::entity(0, $method->name, $reflector->name)); } } }