Puli\Repository\Api\Resource\PuliResource::getName PHP Метод

getName() публичный Метод

The name is the last segment of the path returned by {@link getPath()}.
public getName ( ) : string | null
Результат string | null The name of the resource. If the resource has no path, `null` is returned.
    public function getName();

Usage Example

Пример #1
0
 /**
  * Formats the name of the resource.
  *
  * Resources with children are colored.
  *
  * @param PuliResource $resource The resource.
  *
  * @return string|null The formatted name.
  */
 private function formatName(PuliResource $resource)
 {
     $name = $resource->getName();
     if ($resource->hasChildren()) {
         return '<c1>' . $name . '</c1>';
     }
     return $name;
 }