fredpalas / couchbase-bundle
use couchbase with doctrine
0.1.2
2018-02-18 11:42 UTC
Requires
- php: >=7.0.0
- doctrine/doctrine-bundle: ~1.6
- doctrine/orm: ~2.5
- jms/serializer-bundle: ^2.1
- symfony/console: 2.7|2.8|^3.0
- symfony/framework-bundle: 2.7|2.8|^3.0
Requires (Dev)
- phpunit/phpunit: ^7.0
This package is not auto-updated.
Last update: 2025-05-11 08:29:26 UTC
README
Bundle for connect Couchbase with Doctrine ORM The Bundle use the model like Doctrien ORM except for the relations (working in progress with N1QL Join). For retrive the data for key view are used working in progress to use N1QL and Index (mandatory for quick searchs)
Installation
Open a command console, enter your project directory and execute the following command to download the latest version of this bundle:
composer require fredpalas/couchbase-bundle
// app/AppKernel.php public function registerBundles() { $bundles = array( // ... new Apperturedev\CouchbaseBundle\CouchbaseBundle(), ); }
# app/config/config.yml couchbase: url: <couchbase.url> buckets: default: #dafult bucket bucket_name: <bucket name>
Requirements
Documentation
//in action throw container public function indexAction() { /** @var Apperturedev\CouchbaseBundle\Classes\CouchbaseORM $couchbase editor Helper */ $couchbase = $this->get('couchbase'); $entity = New Entity(); // do anything // save $couchbase->save($entity); $entity->getId(); // Will set the id Automatic $repository = $couchbase->getRepository('Bundle:Entity'); // get data $entity1 = $repository->getById(1); /** For Run Couchbase View you need to run bin/console couchbase:generate:view Bundle:Entity */ /** Fixing a bug for moving old version class */ // country example $query = $repository->get('country'); $query->key('Spain')->order(\CouchbaseViewQuery::ORDER_ASCENDING)->limit(6); // Will return a array if more than 1 or the object if is 1 $country = $repository->execute($query); }