forked from ornicar/ltc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
331 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
src/Ltc/ArticleBundle/Resources/views/Article/featured.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
{% extends "LtcArticle:Article:preview.html.twig" %} | ||
<span class="title">A propos de {{ title }}</span> | ||
{% include "LtcArticle:Article:preview.html.twig" with {"doc": doc} %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<?php | ||
|
||
namespace Ltc\ConfigBundle\Document; | ||
|
||
use Ltc\ArticleBundle\Document\Article; | ||
|
||
/** | ||
* @mongodb:Document | ||
*/ | ||
class FeaturedArticle | ||
{ | ||
/** | ||
* Unique ID | ||
* | ||
* @var string | ||
* @mongodb:Id() | ||
*/ | ||
protected $id; | ||
|
||
/** | ||
* Article | ||
* | ||
* @var Article | ||
* @mongodb:ReferenceOne(targetDocument="Ltc\ArticleBundle\Document\Article") | ||
*/ | ||
protected $article; | ||
|
||
/** | ||
* Title | ||
* | ||
* @var string | ||
* @mongodb:Field(type="string") | ||
*/ | ||
protected $title; | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getTitle() | ||
{ | ||
return $this->title; | ||
} | ||
|
||
/** | ||
* @param string | ||
* @return null | ||
*/ | ||
public function setTitle($title) | ||
{ | ||
$this->title = $title; | ||
} | ||
|
||
/** | ||
* @return Article | ||
*/ | ||
public function getArticle() | ||
{ | ||
return $this->article; | ||
} | ||
|
||
/** | ||
* @param Article | ||
* @return null | ||
*/ | ||
public function setArticle(Article $article) | ||
{ | ||
$this->article = $article; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
namespace Ltc\ConfigBundle\Document; | ||
|
||
use Ltc\StoryBundle\Document\Story; | ||
|
||
/** | ||
* @mongodb:Document | ||
*/ | ||
class FeaturedStory | ||
{ | ||
/** | ||
* Unique ID | ||
* | ||
* @var string | ||
* @mongodb:Id() | ||
*/ | ||
protected $id; | ||
|
||
/** | ||
* Story | ||
* | ||
* @var Story | ||
* @mongodb:ReferenceOne(targetDocument="Ltc\StoryBundle\Document\Story") | ||
*/ | ||
protected $story; | ||
|
||
/** | ||
* @return Story | ||
*/ | ||
public function getStory() | ||
{ | ||
return $this->story; | ||
} | ||
|
||
/** | ||
* @param Story | ||
* @return null | ||
*/ | ||
public function setStory(Story $story) | ||
{ | ||
$this->story = $story; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace Ltc\ConfigBundle\Form; | ||
|
||
use Symfony\Component\Form\Form; | ||
use Symfony\Component\Form\ChoiceField; | ||
use Symfony\Component\Form\TextField; | ||
use Ltc\ArticleBundle\Document\ArticleRepository; | ||
use Ltc\CoreBundle\Form\ValueTransformer\DoctrineObjectTransformer; | ||
|
||
class FeaturedArticleForm extends Form | ||
{ | ||
public function configure() | ||
{ | ||
$this->add(new TextField('title')); | ||
} | ||
|
||
public function setArticleRepository(ArticleRepository $articleRepository) | ||
{ | ||
$field = new ChoiceField('article', array( | ||
'choices' => $articleRepository->findAllPublishedSortByCategory()->toArray() | ||
)); | ||
$field->setValueTransformer(new DoctrineObjectTransformer($articleRepository)); | ||
$this->add($field); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace Ltc\ConfigBundle\Form; | ||
|
||
use Symfony\Component\Form\Form; | ||
use Symfony\Component\Form\ChoiceField; | ||
use Ltc\StoryBundle\Document\StoryRepository; | ||
use Ltc\CoreBundle\Form\ValueTransformer\DoctrineObjectTransformer; | ||
|
||
class FeaturedStoryForm extends Form | ||
{ | ||
public function configure() | ||
{ | ||
} | ||
|
||
public function setStoryRepository(StoryRepository $storyRepository) | ||
{ | ||
$field = new ChoiceField('story', array( | ||
'choices' => $storyRepository->findAll()->toArray() | ||
)); | ||
$field->setValueTransformer(new DoctrineObjectTransformer($storyRepository)); | ||
$this->add($field); | ||
} | ||
} |
Oops, something went wrong.