From 3eaf909b1fa8b07c6d8b23aa2c2ed3ec4e1932b7 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Mon, 21 Jun 2021 19:18:35 +0200 Subject: Rename "attr" method of Item class to "get" --- core/namespace/Application.php | 6 +++--- core/namespace/Item.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'core/namespace') diff --git a/core/namespace/Application.php b/core/namespace/Application.php index 4414665..f9a8196 100644 --- a/core/namespace/Application.php +++ b/core/namespace/Application.php @@ -146,13 +146,13 @@ class Application { switch($class = get_class($Entity)) { case 'Page\Item': $attr = self::get('PAGE.SLUG_URLS') ? 'slug' : 'id'; - return self::getPageURL($Entity->attr($attr).'/'); + return self::getPageURL($Entity->get($attr).'/'); case 'Post\Item': $attr = self::get('POST.SLUG_URLS') ? 'slug' : 'id'; - return self::getPostURL($Entity->attr($attr).'/'); + return self::getPostURL($Entity->get($attr).'/'); case 'User\Item': $attr = self::get('USER.SLUG_URLS') ? 'slug' : 'id'; - return self::getUserURL($Entity->attr($attr).'/'); + return self::getUserURL($Entity->get($attr).'/'); default: $error = 'Unknown URL handler for %s entities.'; throw new Exception(sprintf($error, $class)); diff --git a/core/namespace/Item.php b/core/namespace/Item.php index 74b5688..453a3e6 100644 --- a/core/namespace/Item.php +++ b/core/namespace/Item.php @@ -32,7 +32,7 @@ abstract class Item implements ItemInterface { #=============================================================================== # Return attribute by name (short hand wrapper) #=============================================================================== - public function attr($attribute) { + public function get($attribute) { return $this->Attribute->get($attribute); } -- cgit v1.2.3