li3_behaviors\data\model\Behaviors::_classesForBehavior()

protected static method

Helper method to retrieve current model class and behavior class for name.

Parameters

  • string|object $name

    The name of the behavior or an instance of it.

Returns

array

An array usable with list() with the model and behavior classes.

Source

	protected static function _classesForBehavior($name) {
		$model = get_called_class();

		if (is_object($name)) {
			$class = get_class($name);
		} elseif (!$class = Libraries::locate('behavior', $name)) {
			throw new RuntimeException("No behavior named `{$name}` found.");
		}
		return [$model, $class];
	}