/** * 2016-08-03 * @return string */ protected function entityC() { if (!isset($this->{__METHOD__})) { $this->{__METHOD__} = $this->fc('dfEntity'); df_assert_class_exists($this->{__METHOD__}); } return $this->{__METHOD__}; }
/** * 2016-11-10 * @param string|object $v * @param string|object|null $class * @param string|\Exception|null $message [optional] * @return string|object * @throws DFE */ function df_ar($v, $class, $message = null) { if ($class && df_enable_assertions()) { $class = df_cts($class); !is_null($v) ?: df_error($message ?: "Expected class: «{$class}», given NULL."); is_object($v) || is_string($v) ?: df_error($message ?: "Expected class: «{$class}», given: a value «%s» of type «%s».", df_dump($v), gettype($v)); /** @var string $cv */ $cv = df_cts($v); df_assert_class_exists($cv); if (!is_a($cv, $class, true)) { df_error($message ?: "Expected class: «{$class}», given class: «{$cv}»."); } } return $v; }