2011-06-07 20:13:34 +02:00
|
|
|
<?php
|
|
|
|
|
2013-03-27 18:39:28 +01:00
|
|
|
namespace FOS\ElasticaBundle\Persister;
|
2011-06-07 20:13:34 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Inserts, replaces and deletes single documents in an elastica type
|
|
|
|
* Accepts domain model objects and converts them to elastica documents
|
|
|
|
*
|
|
|
|
* @author Thibault Duplessis <thibault.duplessis@gmail.com>
|
|
|
|
*/
|
|
|
|
interface ObjectPersisterInterface
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Insert one object into the type
|
|
|
|
* The object will be transformed to an elastica document
|
|
|
|
*
|
|
|
|
* @param object $object
|
|
|
|
*/
|
|
|
|
function insertOne($object);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Replaces one object in the type
|
|
|
|
*
|
|
|
|
* @param object $object
|
|
|
|
**/
|
|
|
|
function replaceOne($object);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Deletes one object in the type
|
|
|
|
*
|
|
|
|
* @param object $object
|
|
|
|
**/
|
|
|
|
function deleteOne($object);
|
|
|
|
|
2012-01-25 20:51:10 +01:00
|
|
|
/**
|
|
|
|
* Deletes one object in the type by id
|
|
|
|
*
|
|
|
|
* @param mixed $id
|
|
|
|
*
|
|
|
|
* @return null
|
|
|
|
**/
|
|
|
|
function deleteById($id);
|
|
|
|
|
2011-06-07 20:13:34 +02:00
|
|
|
/**
|
|
|
|
* Inserts an array of objects in the type
|
|
|
|
*
|
|
|
|
* @param array of domain model objects
|
|
|
|
**/
|
|
|
|
function insertMany(array $objects);
|
|
|
|
}
|