Pros:
Cons:
AnnotationRegistry, EventManager), reducing friction for teams already using Doctrine ORM.update or delete) a requirement? CouchDB’s design may limit efficiency here.couchdb-cli) acceptable, or does the team prefer managed solutions?composer.json configuration required.doctrine/annotations, doctrine/event-manager).doctrine/couchdb-odm).composer require doctrine/couchdb-odm-bundle
app/Kernel.php:
new Doctrine\Bundle\CouchDBBundle\DoctrineCouchDBBundle(),
app/config/config.yml:
doctrine_couch_db:
client:
dbname: app_db
host: localhost
port: 5984
username: admin
password: secret
odm:
auto_mapping: true
@CouchDB\Document).namespace AppBundle\Document;
use Doctrine\ODM\CouchDB\Mapping\Annotations as CouchDB;
/**
* @CouchDB\Document(repositoryClass="AppBundle\Repository\UserRepository")
*/
class User {
/** @CouchDB\Id */
private $id;
/** @CouchDB\Field(type="string") */
private $name;
}
namespace AppBundle\Repository;
use Doctrine\ODM\CouchDB\DocumentRepository;
class UserRepository extends DocumentRepository {
public function findByName($name) {
return $this->createQueryBuilder('u')
->where('u.name = :name')
->setParameter('name', $name)
->getQuery()
->execute();
}
}
DocumentManager into services:
use Doctrine\ODM\CouchDB\DocumentManager;
class UserService {
private $dm;
public function __construct(DocumentManager $dm) {
$this->dm = $dm;
}
public function createUser(string $name)
How can I help you explore Laravel packages today?