Skip to content

Instantly share code, notes, and snippets.

@pspanja
Created September 25, 2012 11:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pspanja/3781309 to your computer and use it in GitHub Desktop.
Save pspanja/3781309 to your computer and use it in GitHub Desktop.
URLInfo
<?php
/**
* File containing the eZ\Publish\API\Repository\Values\Content\URLAlias class.
*
* @copyright Copyright (C) 1999-2012 eZ Systems AS. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
* @version //autogentag//
*/
namespace eZ\Publish\API\Repository\Values\Content;
use eZ\Publish\API\Repository\Values\ValueObject;
/**
* This class is used for reading URL information from the repository
*
* @property-read int $type The type of the URL Alias i.e. one of URLAlias::LOCATION, URLAlias::RESOURCE, URLAlias::VIRTUAL
* @property-read mixed $destination If type = URLAlias::LOCATION the locationId otherwise a string (e.g. /content/search)
* @property-read string $caseVerifiedPath The case verified path
* @property-read array $pathLanguageData The languages for which this path is valid
* @property-read boolean $isHistory Indicates that this alias was autogenerated for an in the meanwhile archived version of the content
* @property-read boolean $isCustom If false this alias was autogenerated otherwise manuel created
* @property-read boolean $forward Indicates if the url should be redirected
*/
class URLInfo extends ValueObject
{
/**
* The type of the URL i.e. one of URLAlias::LOCATION, URLAlias::RESOURCE, URLAlias::VIRTUAL
*
* @var int
*/
protected $type;
/**
* If type = URLAlias::LOCATION the locationId
* otherwise a string (e.g. /content/search)
*
* @var mixed
*/
protected $destination;
/**
* The full path of the URL
*
* @var string
*/
protected $path;
/**
* The case verified URL string
*
* @var string
*/
protected $caseVerifiedPath;
/**
* The language information for the URL.
*
* Contains always available and language codes for each part of the URL.
*
* Example:
* <code>
* array(
* array(
* "always-available" => true,
* "language-codes" => array( "cro-HR" )
* ),
* array(
* "always-available" => false,
* "language-codes" => array( "eng-GB" )
* )
* )
* </code>
*
* @var array
*/
protected $pathLanguageData;
/**
* Indicates that this URL contains elements autogenerated for in the meanwhile renamed content
*
* @var boolean
*/
protected $isHistory;
/**
* If false this URL was autogenerated otherwise manually created
*
* @var boolean
*/
protected $isCustom;
/**
* Indicates if the URL should be redirected
*
* @var boolean
*/
protected $forward;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment