Doctrine\OXM\Id\IncrementGenerator::generate PHP Метод

generate() публичный Метод

public generate ( XmlEntityManager $xem, $xmlEntity )
$xem Doctrine\OXM\XmlEntityManager
    public function generate(XmlEntityManager $xem, $xmlEntity)
    {
        $className = get_class($xmlEntity);
        // keep a file marker on the filesystem with the "next" number in it
        //        $db = $xem->getDocumentDatabase($className);
        //        $coll = $dm->getDocumentCollection($className);
        //
        //        $query = array('_id' => $coll->getName());
        //        $newObj = array('$inc' => array('current_id' => 1));
        //
        //        $command = array();
        //        $command['findandmodify'] = 'doctrine_increment_ids';
        //        $command['query'] = $query;
        //        $command['update'] = $newObj;
        //        $command['upsert'] = true;
        //        $command['new'] = true;
        //        $result = $db->command($command);
        //        return $result['value']['current_id'];
    }
IncrementGenerator