return true;
}
- if (($entity->isA('chapter') || $entity->isA('page')) && $this->isA('book')) {
+ if (($entity instanceof BookChild) && $this instanceof Book) {
return $entity->book_id === $this->id;
}
- if ($entity->isA('page') && $this->isA('chapter')) {
+ if ($entity instanceof Page && $this instanceof Chapter) {
return $entity->chapter_id === $this->id;
}
/**
* Check if this instance or class is a certain type of entity.
* Examples of $type are 'page', 'book', 'chapter'.
+ *
* @deprecated Use instanceof instead.
*/
public static function isA(string $type): bool