/**
* @param Site $site
* @param Document $document
* @return int
*/
public function getDocumentIdFromHardlinkInSameSite(Site $site, Document $document)
{
return $this->db->fetchOne("SELECT documents.id FROM documents\n LEFT JOIN documents_hardlink ON documents.id = documents_hardlink.id\n WHERE documents_hardlink.sourceId = ? AND documents.path LIKE ?", array($document->getId(), $site->getRootPath() . "/%"));
}