Skip to content

Instantly share code, notes, and snippets.

@bestform
Last active August 29, 2015 14:11
Show Gist options
  • Save bestform/b8a307aa331cf8e7f51a to your computer and use it in GitHub Desktop.
Save bestform/b8a307aa331cf8e7f51a to your computer and use it in GitHub Desktop.
<?php
namespace ChameleonSystem\ElasticsearchBundle\Document;
use ONGR\ElasticsearchBundle\Annotation as ES;
use ONGR\ElasticsearchBundle\Document\DocumentInterface;
use ONGR\ElasticsearchBundle\Document\DocumentTrait;
/**
* @ES\Document
*/
class ShopArticleDocument implements DocumentInterface {
use DocumentTrait;
/**
* @var string
*
* @ES\Property(name="name", type="string", analyzer="simple")
*/
private $name;
/**
* @var string
*
* @ES\Property(name="description", type="string", analyzer="simple")
*/
private $description;
/**
* @var string
*
* @ES\Property(name="category", type="string", analyzer="simple")
*/
private $category;
/**
* @var string
*
* @ES\Property(name="manufacturer", type="string", analyzer="simple", fields={@ES\MultiField(name="raw", type="string", index="not_analyzed")})
*
*/
private $manufacturer;
/**
* @var string
*
* @ES\Property(name="price", type="integer")
*/
private $price;
/**
* @var int
*
* @ES\Property(name="viewCount", type="integer")
*/
private $viewCount;
/**
* @var float
*
* @ES\Property(name="averageRating", type="float")
*/
private $averageRating;
/**
* @var int
*
* @ES\Property(name="sales", type="integer")
*/
private $sales;
public function getName() {
return $this->name;
}
public function setName($name) {
$this->name = $name;
}
public function getDescription() {
return $this->description;
}
public function setDescription($description) {
$this->description = $description;
}
public function getCategory() {
return $this->category;
}
public function setCategory($category) {
$this->category = $category;
}
public function getManufacturer() {
return $this->manufacturer;
}
public function setManufacturer($manufacturer) {
$this->manufacturer = $manufacturer;
}
public function getPrice() {
return $this->price;
}
public function setPrice($price) {
$this->price = $price;
}
/**
* @return int
*/
public function getViewCount()
{
return $this->viewCount;
}
/**
* @param int $viewCount
*/
public function setViewCount($viewCount)
{
$this->viewCount = $viewCount;
}
/**
* @return mixed
*/
public function getAverageRating()
{
return $this->averageRating;
}
/**
* @param mixed $averageRating
*/
public function setAverageRating($averageRating)
{
$this->averageRating = $averageRating;
}
/**
* @return int
*/
public function getSales()
{
return $this->sales;
}
/**
* @param int $sales
*/
public function setSales($sales)
{
$this->sales = $sales;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment