Skip to content

Commit

Permalink
Created extendable ES Documents;
Browse files Browse the repository at this point in the history
Document/Traits marked as deprecated;
Updated CategoryService, TwigExtensions and tests;
  • Loading branch information
Mindaugas Rukas committed Jan 9, 2015
1 parent 77f1bdd commit 3134bbe
Show file tree
Hide file tree
Showing 37 changed files with 1,113 additions and 131 deletions.
2 changes: 0 additions & 2 deletions Controller/ContentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

/**
* Controller for content pages.
*
* @SuppressWarnings(UnusedFormalParameter)
*/
class ContentController extends Controller
{
Expand Down
45 changes: 45 additions & 0 deletions Document/AbstractCdnObject.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<?php

/*
* This file is part of the ONGR package.
*
* (c) NFQ Technologies UAB <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace ONGR\ContentBundle\Document;

use ONGR\ElasticsearchBundle\Annotation as ES;

/**
* Object used for documents which require CdnObject standard fields.
*
* @ES\Object
*/
abstract class AbstractCdnObject
{
/**
* @var string
*
* @ES\Property(name="cdn_url", type="string")
*/
private $cdnUrl;

/**
* @param string $cdnUrl
*/
public function setCdnUrl($cdnUrl)
{
$this->cdnUrl = $cdnUrl;
}

/**
* @return string
*/
public function getCdnUrl()
{
return $this->cdnUrl;
}
}
91 changes: 91 additions & 0 deletions Document/AbstractImageNested.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?php

/*
* This file is part of the ONGR package.
*
* (c) NFQ Technologies UAB <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace ONGR\ContentBundle\Document;

use ONGR\ElasticsearchBundle\Annotation as ES;

/**
* Nested used for documents which require ImageNested standard fields.
*
* @ES\Nested
*/
abstract class AbstractImageNested
{
/**
* @var string
*
* @ES\Property(name="url", type="string")
*/
private $url;

/**
* @var string
*
* @ES\Property(name="title", type="string", index="no")
*/
private $title;

/**
* @var string
*
* @ES\Property(name="description", type="string", index="no")
*/
private $description;

/**
* @param string $url
*/
public function setUrl($url)
{
$this->url = $url;
}

/**
* @return string
*/
public function getUrl()
{
return $this->url;
}

/**
* @param string $title
*/
public function setTitle($title)
{
$this->title = $title;
}

/**
* @return string
*/
public function getTitle()
{
return $this->title;
}

/**
* @param string $description
*/
public function setDescription($description)
{
$this->description = $description;
}

/**
* @return string
*/
public function getDescription()
{
return $this->description;
}
}
68 changes: 68 additions & 0 deletions Document/AbstractUrlObject.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<?php

/*
* This file is part of the ONGR package.
*
* (c) NFQ Technologies UAB <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace ONGR\ContentBundle\Document;

use ONGR\ElasticsearchBundle\Annotation as ES;

/**
* Object used for documents which require UrlObject standard fields.
*
* @ES\Object
*/
abstract class AbstractUrlObject
{
/**
* @var string
*
* @ES\Property(name="url", type="string")
*/
private $url;

/**
* @var string
*
* @ES\Property(name="key", type="string", index="no")
*/
private $urlKey;

/**
* @return string
*/
public function getUrl()
{
return $this->url;
}

/**
* @param string $url
*/
public function setUrl($url)
{
$this->url = $url;
}

/**
* @param string $urlKey
*/
public function setUrlKey($urlKey)
{
$this->urlKey = $urlKey;
}

/**
* @return string
*/
public function getUrlKey()
{
return $this->urlKey;
}
}
Loading

0 comments on commit 3134bbe

Please sign in to comment.