/**
* Finds all objects in the repository.
*
* @return mixed The objects.
*/
public function findAll()
{
// TODO: Implement findAll() method.
// Hackety Hack
$storage = $this->xem->getStorage();
$storagePath = $storage->getStoragePath();
$storageDir = $storagePath . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $this->getClassName());
$dirHandle = opendir($storageDir);
$ids = array();
$pattern = '*.' . $storage->getFileExtension();
while ($handle = readdir($dirHandle)) {
if (fnmatch($pattern, $handle)) {
$ids[] = basename($handle, '.' . $storage->getFileExtension());
}
}
$objects = array();
if (!empty($ids)) {
foreach ($ids as $id) {
$object = $this->find($id);
if ($object) {
$objects[] = $object;
}
}
}
return $objects;
}