This file contains hidden or 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
<?php | |
class PostController extends Controller | |
{ | |
/** | |
* @throws \Symfony\Component\HttpKernel\Exception\NotFoundHttpException | |
* @param $permalink | |
* @return \Symfony\Bundle\FrameworkBundle\Controller\Response | |
*/ | |
public function viewAction($permalink) |
This file contains hidden or 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
<html> | |
<head {{ sonata_seo_head_attributes() }}> | |
{{ sonata_seo_title() }} | |
{{ sonata_seo_metadatas() }} | |
</head> | |
<body class="sonata-bc"> | |
<!-- page --> |
This file contains hidden or 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
<?php | |
namespace Sonata\Bundle\DemoBundle\Controller; | |
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | |
use Sonata\Bundle\DemoBundle\Model\MediaPreview; | |
use Symfony\Component\HttpFoundation\Request; | |
class DemoController extends Controller | |
{ |
This file contains hidden or 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
<div> | |
<form method="POST"> | |
{{ form_widget(form.media.binaryContent, {'attr': {'class': 'span8'}}) }} | |
{{ form_rest(form) }} | |
<input type="submit" class="btn" value="Preview Video"/> | |
</form> | |
</div> |
This file contains hidden or 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
<?php | |
$this->getSeoPage() | |
->setTitle($media->getName()) | |
->addMeta('property', 'og:description', $media->getDescription()) | |
->addMeta('property', 'og:type', 'video') | |
; |
This file contains hidden or 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
<?php | |
$media = new Media; | |
$media->setProviderName('sonata.media.provider.image'); | |
$media->setContext('default'); | |
$media->setBinaryContent('/path/to/file'); | |
$post = new Post; | |
$post->setMedia($media); |
This file contains hidden or 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
/** | |
* {@inheritdoc} | |
*/ | |
public function getStatus() | |
{ | |
$states = $this->messageManager->countStates(); | |
if ($states[MessageInterface::STATE_OPEN] > $this->checkLevel[MessageInterface::STATE_OPEN]) { | |
return new BackendStatus(BackendStatus::CRITICAL, 'Too much messages waiting to be processed'); | |
} |
This file contains hidden or 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
<?php | |
// service | |
interface BlockExecuteFactoryInterface | |
{ | |
function getExecutionContext(BlockInterface $block); | |
} | |
// object, one per block | |
interface BlockExecutionContextInterface |
This file contains hidden or 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
assetic: | |
debug: false | |
use_controller: false | |
read_from: %kernel.root_dir%/../web | |
write_to: %kernel.root_dir%/../web | |
dump_on_warmup: false # do not compile on cache warmup | |
bundles: [] # disable bundles parsing | |
filters: | |
yui_js: |
This file contains hidden or 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
diff --git a/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php b/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php | |
index 2cad8a4..51c4924 100644 | |
--- a/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php | |
+++ b/lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php | |
@@ -127,6 +127,16 @@ class XmlExporter extends AbstractExporter | |
} | |
} | |
+ foreach ($metadata->associationMappings as $name => $field) { | |
+ if (isset($field['id']) && $field['id']) { |