/** * Checks if a file belongs to an item. * * @param File $file File to check. * * @return boolean */ protected function _checkItemFile($file) { // Get the item. $item = $file->getItem(); // Check if the found file belongs to the item. if (!empty($this->_item_identifier)) { // Get the item identifier. $item_identifier = $this->view->getRecordIdentifier($item, false); // Check identifier and id of item. if (strtolower($this->_item_identifier) != strtolower($item_identifier) && $this->_item_identifier != $item->id) { return false; } } return true; }