Jarves\Objects::getName PHP Method

getName() public method

jarves/node => Node.
public getName ( string $objectKey ) : string | null
$objectKey string
return string | null
    public function getName($objectKey)
    {
        $objectKey = Objects::normalizeObjectKey($objectKey);
        $temp = explode('/', $objectKey);
        $config = $this->jarves->getConfig($temp[0]);
        if ($config && ($object = $config->getObject($temp[1]))) {
            return $object->getId();
        }
        return null;
    }

Usage Example

Beispiel #1
0
 /**
  * Returns php class name.
  *
  * @param  string $objectName
  *
  * @return string
  */
 public function getPhpName($objectName = null)
 {
     $clazz = Objects::normalizeObjectKey($objectName ?: $this->getObjectKey());
     $clazz = $this->objects->getNamespace($clazz) . '\\Model\\' . ucfirst($this->objects->getName($clazz));
     return $clazz;
 }