/**
* Handler for when an unknown/unhooked function call is executed
*
* @param string $method Requested method name
* @param array $arguments Arguments provided
* @return null|mixed
* @throws WireException
*
*/
protected function ___callUnknown($method, $arguments)
{
if (!isset($arguments[0])) {
// explode the property to an array
return $this->explode($method);
} else {
if (is_string($arguments[0])) {
// implode the property identified by $method and glued by $arguments[0]
// with optional $options as second argument
$delimiter = $arguments[0];
$options = array();
if (isset($arguments[1]) && is_array($arguments[1])) {
$options = $arguments[1];
}
return $this->implode($delimiter, $method, $options);
} else {
// fail
return parent::___callUnknown($method, $arguments);
}
}
}