Skip to content

Instantly share code, notes, and snippets.

@simensen
Created January 27, 2010 22:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simensen/288226 to your computer and use it in GitHub Desktop.
Save simensen/288226 to your computer and use it in GitHub Desktop.
<?php
hc_core_ClassLoader::load('s3a_domain_AbstractReposeRepository');
hc_core_ClassLoader::load('s3a_domain_ISpaceRepository');
hc_core_ClassLoader::load('s3a_domain_model_Space');
hc_core_ClassLoader::load('s3a_domain_model_SpaceNeighborhood');
hc_core_ClassLoader::load('s3a_domain_model_SpaceUri');
hc_core_ClassLoader::load('s3a_domain_model_Neighborhood');
hc_core_ClassLoader::load('repose_SessionFactory');
class s3a_domain_ReposeSpaceRepository extends s3a_domain_AbstractReposeRepository implements s3a_domain_ISpaceRepository {
public function __construct(repose_SessionFactory $sessionFactory) {
parent::__construct($sessionFactory);
}
public function find($spaceSymName) {
}
public function findById($spaceId) {
return $this->getSession()->load('s3a_domain_model_Space', $spaceId);
}
public function findAll() {
return $this->getSession()->createQuery('FROM s3a_domain_model_Space space')->execute();
}
public function save(s3a_domain_model_Space $space) {
return $this->getSession()->saveOrUpdate($space);
}
public function saveSpaceUri(s3a_domain_model_SpaceUri $spaceUri) {
return $this->getSession()->saveOrUpdate($spaceUri);
}
public function addNeighborhood(s3a_domain_model_Space $space, s3a_domain_model_Neighborhood $neighborhood) {
$this->getSession()->set(new s3a_domain_model_SpaceNeighborhood($space, $neighborhood));
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment