Entry
class Entry extends LocalizedResource implements EntryInterface, ArrayAccess
Properties
protected string[] | $localeCodes | List of codes for all the locales available in the space this resource belongs to. | from LocalizedResource |
protected Entry | $sys | ||
protected array | $fields | ||
protected ClientInterface | $client |
Methods
Resources in this SDK should not be built using $new Class()
.
{@inheritdoc}
Returns the space this entry belongs to.
Returns the environment this entry belongs to.
No description
No description
Shortcut for accessing fields using $entry->fieldName.
{@inheritdoc}
{@inheritdoc}
{@inheritdoc}
{@inheritdoc}
Checks whether the current entry has a field with a certain ID.
No description
Returns all fields of the current entry, with some optimizations applied.
Returns a the value of a field using the given locale.
{@inheritdoc}
Details
in BaseResource at line 24
protected
__construct(array $data)
Resources in this SDK should not be built using $new Class()
.
This method is only useful in testing environments, where the resource needs to be subclasses and this method made public.
in BaseResource at line 36
asLink()
{@inheritdoc}
in BaseResource at line 47
getId()
{@inheritdoc}
in BaseResource at line 55
getType()
{@inheritdoc}
in LocalizedResource at line 41
initLocales(array $locales)
in LocalizedResource at line 65
$this
setLocale(Locale|string $locale)
Set the locale for this instance.
All future calls to a getter will return the information for this locale.
in LocalizedResource at line 77
getLocale()
The locale code for the currently set locale.
It will be either the default locale if the resource was fetched using "locale=*", or the one that was used in the API request.
in LocalizedResource at line 87
protected
getLocaleFromInput(Locale|string|null $input = null)
in LocalizedResource at line 113
protected string|null
walkFallbackChain(array $valueMap, string $localeCode, Environment $environment)
at line 42
getSystemProperties()
{@inheritdoc}
at line 50
getSpace()
Returns the space this entry belongs to.
at line 58
getEnvironment()
Returns the environment this entry belongs to.
at line 63
getContentType()
at line 71
mixed
__call(string $name, array $arguments)
at line 110
mixed
__get(string $name)
Shortcut for accessing fields using $entry->fieldName.
It will use the locale currently defined.
at line 118
offsetGet($name)
{@inheritdoc}
at line 126
offsetExists($name)
{@inheritdoc}
at line 134
offsetSet($name, $value)
{@inheritdoc}
at line 142
offsetUnset($name)
{@inheritdoc}
at line 150
has(string $name, string $locale = null, bool $checkLinksAreResolved = true)
Checks whether the current entry has a field with a certain ID.
at line 177
bool
__isset(string $name)
at line 187
all(string $locale = null, bool $resolveLinks = true)
Returns all fields of the current entry, with some optimizations applied.
Links are resolved by default. If you want to get raw link objects rather than complete resources, set the $resolveLinks parameter to false.
at line 216
mixed
get(string $name, string $locale = null, bool $resolveLinks = true)
Returns a the value of a field using the given locale.
It will also resolve links. If you want to access the ID of a link or of an array of links, simply append "Id" to the end of the $name parameter.
$author = $entry->get('author');
$id = $entry->get('authorId');
at line 354
getReferences(Query $query = null)
Gets all entries that contain links to the current one.
You can provide a Query object in order to set parameters such as locale, include, and sorting.
at line 365
jsonSerialize()
{@inheritdoc}