/**
  * @see BackendAdapter::getNumberOfReferences
  */
 public function getNumberOfReferences(Resource $resource)
 {
     return $this->conn->fetchColumn("SELECT COUNT(id) FROM xi_filelib_file WHERE resource_id = ?", array($resource->getId()));
 }
Example #2
0
 /**
  * @see BackendAdapter::getNumberOfReferences
  */
 public function getNumberOfReferences(Resource $resource)
 {
     $this->init();
     $count = 0;
     foreach ($this->json['files'] as $file) {
         if ($file['resource_id'] == $resource->getId()) {
             $count = $count + 1;
         }
     }
     return $count;
 }
Example #3
0
 public function delete(Resource $resource)
 {
     if (isset($this->retrieved[$resource->getId()])) {
         unset($this->retrieved[$resource->getId()]);
     }
 }
 /**
  * @see BackendAdapter::getNumberOfReferences
  */
 public function getNumberOfReferences(Resource $resource)
 {
     $refs = $this->getMongo()->files->find(array('resource_id' => $resource->getId()));
     return $refs->count();
 }
 public function exists(Resource $resource)
 {
     return isset($this->resources[$resource->getId()]);
 }