Skip to content

Instantly share code, notes, and snippets.

@AlexTiTanium
Created January 9, 2013 21:21
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 AlexTiTanium/4497067 to your computer and use it in GitHub Desktop.
Save AlexTiTanium/4497067 to your computer and use it in GitHub Desktop.
<?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