Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/7.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Nattfarinn committed Mar 26, 2018
2 parents 5105714 + b7f11f5 commit d4f276b
Showing 1 changed file with 40 additions and 2 deletions.
42 changes: 40 additions & 2 deletions Repository/Values/Content/ContentInfo.php
Expand Up @@ -25,10 +25,15 @@
* @property-read bool $alwaysAvailable Indicates if the Content object is shown in the mainlanguage if its not present in an other requested language
* @property-read string $remoteId a global unique id of the Content object
* @property-read string $mainLanguageCode The main language code of the Content object. If the available flag is set to true the Content is shown in this language if the requested language does not exist.
* @property-read mixed|null $mainLocationId Identifier of the main location.
* @property-read mixed $mainLocationId Identifier of the main location.
* @property-read int $status status of the Content object
*/
class ContentInfo extends ValueObject
{
const STATUS_DRAFT = 0;
const STATUS_PUBLISHED = 1;
const STATUS_TRASHED = 2;

/**
* The unique id of the Content object.
*
Expand Down Expand Up @@ -122,7 +127,40 @@ class ContentInfo extends ValueObject
* If the Content object has multiple locations,
* $mainLocationId will point to the main one.
*
* @var mixed|null
* @var mixed
*/
protected $mainLocationId;

/**
* Status of the content.
*
* Replaces deprecated API\ContentInfo::$published.
*
* @var int
*/
protected $status;

/**
* @return bool
*/
public function isDraft()
{
return $this->status === self::STATUS_DRAFT;
}

/**
* @return bool
*/
public function isPublished()
{
return $this->status === self::STATUS_PUBLISHED;
}

/**
* @return bool
*/
public function isTrashed()
{
return $this->status === self::STATUS_TRASHED;
}
}

0 comments on commit d4f276b

Please sign in to comment.