Created
January 9, 2013 21:21
-
-
Save AlexTiTanium/4497067 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace models\ODM\Repositories; | |
use Doctrine\ODM\MongoDB\DocumentRepository; | |
use Documents\Shop\Products; | |
use lib\Doctrine\DoctrineOdm; | |
/** | |
* ShopProductsRepository | |
* | |
* This class was generated by the Doctrine ORM. Add your own custom | |
* repository methods below. | |
*/ | |
class ShopProductsRepository extends DocumentRepository | |
{ | |
/** | |
* @static | |
* @return ShopProductsRepository | |
*/ | |
static public function getRepository(){ | |
return DoctrineOdm::getRepository('Documents\Shop\Products'); | |
} | |
/** | |
* @param Products $products | |
*/ | |
public function update(Products $products){ | |
$this->dm->persist($products); | |
$this->dm->flush(); | |
} | |
/** | |
* @param Products $products | |
*/ | |
public function delete(Products $products){ | |
$this->dm->remove($products); | |
$this->dm->flush(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment