public function Entity::hasStatus in Entity API 7
Checks if the entity has a certain exportable status.
Parameters
$status: A status constant, i.e. one of ENTITY_CUSTOM, ENTITY_IN_CODE, ENTITY_OVERRIDDEN or ENTITY_FIXED.
Return value
bool For exportable entities TRUE if the entity has the status, else FALSE. In case the entity is not exportable, NULL is returned.
Overrides EntityInterface::hasStatus
See also
File
- includes/
entity.inc, line 324 - Provides a base class for entities.
Class
- Entity
- A common class for entities.
Code
public function hasStatus($status) {
if (!empty($this->entityInfo['exportable'])) {
return isset($this->{$this->statusKey}) && ($this->{$this->statusKey} & $status) == $status;
}
}