Skip to content

Commit

Permalink
Merge pull request #1 from IamPersistent/update
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
ornicar committed Aug 8, 2011
2 parents b364f71 + e313a5a commit bd0f2fd
Show file tree
Hide file tree
Showing 12 changed files with 82 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/config/comment.yml
Expand Up @@ -3,6 +3,7 @@ fos_comment:
class:
model:
comment: Ltc\CommentBundle\Document\Comment
thread: Ltc\CommentBundle\Document\Thread
form:
comment:
type: ltc_comment.comment
Expand Down
3 changes: 1 addition & 2 deletions app/config/config_local.yml.dist
@@ -1,6 +1,5 @@
framework:
csrf_protection:
secret: s3cr3t
secret: s3cr3t

apc:
host: http://ltc
Expand Down
5 changes: 5 additions & 0 deletions src/Ltc/ArticleBundle/Form/ArticleFormType.php
Expand Up @@ -24,4 +24,9 @@ public function buildForm(FormBuilder $builder, array $options)
$builder->add('category');
}
}

public function getName()
{
return 'article';
}
}
25 changes: 25 additions & 0 deletions src/Ltc/CommentBundle/Document/Comment.php
Expand Up @@ -27,6 +27,31 @@ class Comment extends BaseComment
*/
protected $authorName = 'Anonyme';

/**
* Thread of this comment
*
* @var Thread
* @MongoDB\ReferenceOne(targetDocument="MyProject\MyBundle\Document\Thread")
*/
protected $thread;

/**
* @return Thread
*/
public function getThread()
{
return $this->thread;
}

/**
* @param Thread $thread
* @return null
*/
public function setThread(Thread $thread)
{
$this->thread = $thread;
}

/**
* Get authorName
* @return string
Expand Down
15 changes: 15 additions & 0 deletions src/Ltc/CommentBundle/Document/Thread.php
@@ -0,0 +1,15 @@
<?php

namespace Ltc\CommentBundle\Document;

use FOS\CommentBundle\Document\Thread as BaseThread;
use Doctrine\ODM\MongoDB\Mapping\Annotations as MongoDB;

/**
* @MongoDB\Document
* @MongoDB\ChangeTrackingPolicy("DEFERRED_EXPLICIT")
*/
class Thread extends BaseThread
{

}
5 changes: 5 additions & 0 deletions src/Ltc/CommentBundle/Form/CommentFormType.php
Expand Up @@ -19,4 +19,9 @@ public function buildForm(FormBuilder $builder, array $options)

$builder->add('authorName', 'text');
}

public function getName()
{
return 'comment';
}
}
5 changes: 5 additions & 0 deletions src/Ltc/ConfigBundle/Form/AuthorType.php
Expand Up @@ -25,4 +25,9 @@ public function getDefaultOptions(array $options)
'data_class' => 'Ltc\ConfigBundle\Document\Author',
);
}

public function getName()
{
return 'author';
}
}
5 changes: 5 additions & 0 deletions src/Ltc/ConfigBundle/Form/FeaturedArticleType.php
Expand Up @@ -19,4 +19,9 @@ public function getDefaultOptions(array $options)
'data_class' => 'Ltc\ConfigBundle\Document\FeaturedArticle',
);
}

public function getName()
{
return 'featured_article';
}
}
5 changes: 5 additions & 0 deletions src/Ltc/ConfigBundle/Form/FeaturedStoryType.php
Expand Up @@ -18,4 +18,9 @@ public function getDefaultOptions(array $options)
'data_class' => 'Ltc\ConfigBundle\Document\FeaturedStory',
);
}

public function getName()
{
return 'featured_story';
}
}
5 changes: 5 additions & 0 deletions src/Ltc/ConfigBundle/Form/PhotoType.php
Expand Up @@ -23,4 +23,9 @@ public function getDefaultOptions(array $options)
'data_class' => 'Ltc\ConfigBundle\Document\Photo',
);
}

public function getName()
{
return 'article';
}
}
5 changes: 5 additions & 0 deletions src/Ltc/DocBundle/Form/DocFormType.php
Expand Up @@ -23,4 +23,9 @@ public function buildForm(FormBuilder $builder, array $options)
->add('image', 'ltc_image')
;
}

public function getName()
{
return 'doc';
}
}
5 changes: 5 additions & 0 deletions src/Ltc/StoryBundle/Form/StoryFormType.php
Expand Up @@ -16,4 +16,9 @@ public function buildForm(FormBuilder $builder, array $options)
->add('authorName')
;
}

public function getName()
{
return 'story';
}
}

0 comments on commit bd0f2fd

Please sign in to comment.