-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add playlist create/update/remove actions
- Loading branch information
1 parent
8605685
commit 6292f8f
Showing
2 changed files
with
140 additions
and
4 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
42 changes: 42 additions & 0 deletions
42
newscoop/src/Newscoop/GimmeBundle/Form/Type/PlaylistType.php
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,42 @@ | ||
<?php | ||
/** | ||
* @package Newscoop\NewscoopBundle | ||
* @author Paweł Mikołajczuk <[email protected]> | ||
* @copyright 2015 Sourcefabric z.ú. | ||
* @license http://www.gnu.org/licenses/gpl-3.0.txt | ||
*/ | ||
|
||
namespace Newscoop\GimmeBundle\Form\Type; | ||
|
||
use Symfony\Component\Form\AbstractType; | ||
use Symfony\Component\Form\FormBuilderInterface; | ||
use Symfony\Component\OptionsResolver\OptionsResolverInterface; | ||
|
||
class PlaylistType extends AbstractType | ||
{ | ||
public function buildForm(FormBuilderInterface $builder, array $options) | ||
{ | ||
$builder | ||
->add('name', 'text', array( | ||
'required' => true, | ||
)) | ||
->add('notes', 'text', array( | ||
'required' => false, | ||
)) | ||
->add('maxItems', 'integer', array( | ||
'required' => false, | ||
)); | ||
} | ||
|
||
public function getName() | ||
{ | ||
return 'playlist'; | ||
} | ||
|
||
public function setDefaultOptions(OptionsResolverInterface $resolver) | ||
{ | ||
$resolver->setDefaults(array( | ||
'csrf_protection' => false | ||
)); | ||
} | ||
} |