Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

content/location.php
Go to the documentation of this file.
1 <?php
21 class ezpContentLocation extends ezpLocation
22 {
29 public static function fetchByNodeId( $nodeId )
30 {
31 $node = eZContentObjectTreeNode::fetch( $nodeId );
32 if ( $node instanceof eZContentObjectTreeNode )
33 {
34 return self::fromNode( $node );
35 }
36 else
37 {
38 // @TODO Currently this exception is only in rest package. Needs to be fixed.
39 throw new ezpContentNotFoundException( "Unable to find node with ID $nodeId" );
40 }
41 }
42
48 public static function fromNode( eZContentObjectTreeNode $node )
49 {
50 $location = new ezpContentLocation();
51 $location->node = $node;
52
53 return $location;
54 }
55
59 public function __get( $property )
60 {
61 if ( in_array( $property, self::$validNodeAttributes ) && $this->node->hasAttribute( $property ) )
62 return $this->node->attribute( $property );
63 else
64 throw new ezcBasePropertyNotFoundException( $property );
65 }
66
67 protected $node;
68
69 protected static $validNodeAttributes = array( 'node_id', 'path_string', 'name', 'url_alias', 'is_main', 'remote_id' );
70 }
71 ?>
ezpContentLocation
Definition: content/location.php:22
ezpContentLocation\$node
$node
Definition: content/location.php:67
ezpContentLocation\__get
__get( $property)
Definition: content/location.php:59
ezpContentLocation\$validNodeAttributes
static $validNodeAttributes
Definition: content/location.php:69
ezpContentLocation\fetchByNodeId
static fetchByNodeId( $nodeId)
Definition: content/location.php:29
ezpContentLocation\fromNode
static fromNode(eZContentObjectTreeNode $node)
Definition: content/location.php:48
ezpContentNotFoundException
Definition: content_not_found.php:13
ezpLocation
Definition: location.php:17
$location
$location
Definition: user/gotolink.php:43
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.