protected function TinyPngImageHandler::checkEntity in TinyPNG 8
Checks if given entity is a new File entity.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: Entity to check.
Return value
bool Returns TRUE if given entity is a new File.
1 call to TinyPngImageHandler::checkEntity()
- TinyPngImageHandler::shouldHandleEntity in src/
TinyPngImageHandler.php - Checks if we should handle entity.
File
- src/
TinyPngImageHandler.php, line 157
Class
- TinyPngImageHandler
- Class TinyPngImageHandler.
Namespace
Drupal\tinypngCode
protected function checkEntity(EntityInterface $entity) {
return $entity
->isNew() && $entity
->getEntityTypeId() === 'file';
}