Applied php-cs-fixer and added some @PHPDoc

Signed-off-by: Gergely POLONKAI <polesz@w00d5t0ck.info>
This commit is contained in:
Gergely POLONKAI 2012-08-17 16:18:43 +02:00
parent 4772fd2273
commit aed588e5e2
42 changed files with 479 additions and 349 deletions

View File

@ -5,42 +5,42 @@ use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel class AppKernel extends Kernel
{ {
public function registerBundles() public function registerBundles()
{ {
$bundles = array( $bundles = array(
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(), new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(), new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(), new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(), new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(), new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Symfony\Bundle\AsseticBundle\AsseticBundle(), new Symfony\Bundle\AsseticBundle\AsseticBundle(),
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(), new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new JMS\AopBundle\JMSAopBundle(), new JMS\AopBundle\JMSAopBundle(),
new JMS\DiExtraBundle\JMSDiExtraBundle($this), new JMS\DiExtraBundle\JMSDiExtraBundle($this),
new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(), new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
// 3rd party bundles // 3rd party bundles
new Ivory\CKEditorBundle\IvoryCKEditorBundle(), new Ivory\CKEditorBundle\IvoryCKEditorBundle(),
new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(), new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
new Io\TcpdfBundle\IoTcpdfBundle(), new Io\TcpdfBundle\IoTcpdfBundle(),
new FOS\JsRoutingBundle\FOSJsRoutingBundle(), new FOS\JsRoutingBundle\FOSJsRoutingBundle(),
// Own bundles // Own bundles
new KekRozsak\FrontBundle\KekRozsakFrontBundle(), new KekRozsak\FrontBundle\KekRozsakFrontBundle(),
new KekRozsak\SecurityBundle\KekRozsakSecurityBundle(), new KekRozsak\SecurityBundle\KekRozsakSecurityBundle(),
new KekRozsak\AdminBundle\KekRozsakAdminBundle(), new KekRozsak\AdminBundle\KekRozsakAdminBundle(),
); );
if (in_array($this->getEnvironment(), array('dev', 'test'))) { if (in_array($this->getEnvironment(), array('dev', 'test'))) {
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle(); $bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle(); $bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle(); $bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
} }
return $bundles; return $bundles;
} }
public function registerContainerConfiguration(LoaderInterface $loader) public function registerContainerConfiguration(LoaderInterface $loader)
{ {
$loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml'); $loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
} }
} }

View File

@ -5,130 +5,125 @@ namespace Application\Migrations;
use Doctrine\DBAL\Migrations\AbstractMigration, use Doctrine\DBAL\Migrations\AbstractMigration,
Doctrine\DBAL\Schema\Schema; Doctrine\DBAL\Schema\Schema;
/**
* Auto-generated Migration: Please modify to your need!
*/
class Version20120731113533 extends AbstractMigration class Version20120731113533 extends AbstractMigration
{ {
public function up(Schema $schema) public function up(Schema $schema)
{ {
// this up() migration is autogenerated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");
$this->addSql("CREATE TABLE users (id INT AUTO_INCREMENT NOT NULL, accepted_by_id INT DEFAULT NULL, username VARCHAR(50) NOT NULL, password VARCHAR(50) NOT NULL, display_name VARCHAR(50) NOT NULL, email VARCHAR(100) NOT NULL, registered_at DATETIME NOT NULL, last_login_at DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_1483A5E9F85E0677 (username), UNIQUE INDEX UNIQ_1483A5E9D5499347 (display_name), UNIQUE INDEX UNIQ_1483A5E9E7927C74 (email), INDEX IDX_1483A5E920F699D9 (accepted_by_id), PRIMARY KEY(id)) ENGINE = InnoDB"); $this->addSql("CREATE TABLE users (id INT AUTO_INCREMENT NOT NULL, accepted_by_id INT DEFAULT NULL, username VARCHAR(50) NOT NULL, password VARCHAR(50) NOT NULL, display_name VARCHAR(50) NOT NULL, email VARCHAR(100) NOT NULL, registered_at DATETIME NOT NULL, last_login_at DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_1483A5E9F85E0677 (username), UNIQUE INDEX UNIQ_1483A5E9D5499347 (display_name), UNIQUE INDEX UNIQ_1483A5E9E7927C74 (email), INDEX IDX_1483A5E920F699D9 (accepted_by_id), PRIMARY KEY(id)) ENGINE = InnoDB");
$this->addSql("ALTER TABLE users ADD CONSTRAINT FK_1483A5E920F699D9 FOREIGN KEY (accepted_by_id) REFERENCES users (id)"); $this->addSql("ALTER TABLE users ADD CONSTRAINT FK_1483A5E920F699D9 FOREIGN KEY (accepted_by_id) REFERENCES users (id)");
$this->addSql("CREATE TABLE user_data (user_id INT NOT NULL, email_public TINYINT(1) NOT NULL, real_name VARCHAR(100) DEFAULT NULL, real_name_public TINYINT(1) NOT NULL, self_description LONGTEXT DEFAULT NULL, msn_address VARCHAR(100) DEFAULT NULL, msn_address_public TINYINT(1) NOT NULL, google_talk VARCHAR(100) DEFAULT NULL, google_talk_public TINYINT(1) NOT NULL, skype VARCHAR(100) DEFAULT NULL, skype_public TINYINT(1) NOT NULL, phone_number VARCHAR(30) DEFAULT NULL, phone_number_public TINYINT(1) NOT NULL, PRIMARY KEY(user_id)) ENGINE = InnoDB"); $this->addSql("CREATE TABLE user_data (user_id INT NOT NULL, email_public TINYINT(1) NOT NULL, real_name VARCHAR(100) DEFAULT NULL, real_name_public TINYINT(1) NOT NULL, self_description LONGTEXT DEFAULT NULL, msn_address VARCHAR(100) DEFAULT NULL, msn_address_public TINYINT(1) NOT NULL, google_talk VARCHAR(100) DEFAULT NULL, google_talk_public TINYINT(1) NOT NULL, skype VARCHAR(100) DEFAULT NULL, skype_public TINYINT(1) NOT NULL, phone_number VARCHAR(30) DEFAULT NULL, phone_number_public TINYINT(1) NOT NULL, PRIMARY KEY(user_id)) ENGINE = InnoDB");
$this->addSql("ALTER TABLE user_data ADD CONSTRAINT FK_D772BFAAA76ED395 FOREIGN KEY (user_id) REFERENCES users (id)"); $this->addSql("ALTER TABLE user_data ADD CONSTRAINT FK_D772BFAAA76ED395 FOREIGN KEY (user_id) REFERENCES users (id)");
$this->addSql("CREATE TABLE roles (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(50) NOT NULL, `default` TINYINT(1) NOT NULL, admin TINYINT(1) NOT NULL, superAdmin TINYINT(1) NOT NULL, description VARCHAR(150) DEFAULT NULL, short_description VARCHAR(50) NOT NULL, UNIQUE INDEX UNIQ_B63E2EC75E237E06 (name), UNIQUE INDEX UNIQ_B63E2EC79BE5A5B1 (short_description), PRIMARY KEY(id)) ENGINE = InnoDB"); $this->addSql("CREATE TABLE roles (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(50) NOT NULL, `default` TINYINT(1) NOT NULL, admin TINYINT(1) NOT NULL, superAdmin TINYINT(1) NOT NULL, description VARCHAR(150) DEFAULT NULL, short_description VARCHAR(50) NOT NULL, UNIQUE INDEX UNIQ_B63E2EC75E237E06 (name), UNIQUE INDEX UNIQ_B63E2EC79BE5A5B1 (short_description), PRIMARY KEY(id)) ENGINE = InnoDB");
$this->addSql("CREATE TABLE user_role (user_id INT NOT NULL, role_id INT NOT NULL, INDEX IDX_2DE8C6A3A76ED395 (user_id), INDEX IDX_2DE8C6A3D60322AC (role_id), PRIMARY KEY(user_id, role_id)) ENGINE = InnoDB"); $this->addSql("CREATE TABLE user_role (user_id INT NOT NULL, role_id INT NOT NULL, INDEX IDX_2DE8C6A3A76ED395 (user_id), INDEX IDX_2DE8C6A3D60322AC (role_id), PRIMARY KEY(user_id, role_id)) ENGINE = InnoDB");
$this->addSql("ALTER TABLE user_role ADD CONSTRAINT FK_2DE8C6A3A76ED395 FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE"); $this->addSql("ALTER TABLE user_role ADD CONSTRAINT FK_2DE8C6A3A76ED395 FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE");
$this->addSql("ALTER TABLE user_role ADD CONSTRAINT FK_2DE8C6A3D60322AC FOREIGN KEY (role_id) REFERENCES roles (id) ON DELETE CASCADE"); $this->addSql("ALTER TABLE user_role ADD CONSTRAINT FK_2DE8C6A3D60322AC FOREIGN KEY (role_id) REFERENCES roles (id) ON DELETE CASCADE");
$this->addSql("CREATE TABLE news (id INT AUTO_INCREMENT NOT NULL, created_by_id INT DEFAULT NULL, title VARCHAR(100) NOT NULL, text LONGTEXT NOT NULL, created_at DATETIME NOT NULL, public TINYINT(1) NOT NULL, INDEX IDX_1DD39950B03A8386 (created_by_id), PRIMARY KEY(id)) ENGINE = InnoDB"); $this->addSql("CREATE TABLE news (id INT AUTO_INCREMENT NOT NULL, created_by_id INT DEFAULT NULL, title VARCHAR(100) NOT NULL, text LONGTEXT NOT NULL, created_at DATETIME NOT NULL, public TINYINT(1) NOT NULL, INDEX IDX_1DD39950B03A8386 (created_by_id), PRIMARY KEY(id)) ENGINE = InnoDB");
$this->addSql("ALTER TABLE news ADD CONSTRAINT FK_1DD39950B03A8386 FOREIGN KEY (created_by_id) REFERENCES users (id)"); $this->addSql("ALTER TABLE news ADD CONSTRAINT FK_1DD39950B03A8386 FOREIGN KEY (created_by_id) REFERENCES users (id)");
$this->addSql("CREATE TABLE documents (id INT AUTO_INCREMENT NOT NULL, created_by_id INT DEFAULT NULL, title VARCHAR(150) NOT NULL, slug VARCHAR(150) NOT NULL, created_at DATETIME NOT NULL, content LONGTEXT NOT NULL, updatedAt DATETIME DEFAULT NULL, updateReason LONGTEXT DEFAULT NULL, updatedBy_id INT DEFAULT NULL, UNIQUE INDEX UNIQ_A2B072882B36786B (title), UNIQUE INDEX UNIQ_A2B07288989D9B62 (slug), INDEX IDX_A2B07288B03A8386 (created_by_id), INDEX IDX_A2B0728865FF1AEC (updatedBy_id), PRIMARY KEY(id)) ENGINE = InnoDB"); $this->addSql("CREATE TABLE documents (id INT AUTO_INCREMENT NOT NULL, created_by_id INT DEFAULT NULL, title VARCHAR(150) NOT NULL, slug VARCHAR(150) NOT NULL, created_at DATETIME NOT NULL, content LONGTEXT NOT NULL, updatedAt DATETIME DEFAULT NULL, updateReason LONGTEXT DEFAULT NULL, updatedBy_id INT DEFAULT NULL, UNIQUE INDEX UNIQ_A2B072882B36786B (title), UNIQUE INDEX UNIQ_A2B07288989D9B62 (slug), INDEX IDX_A2B07288B03A8386 (created_by_id), INDEX IDX_A2B0728865FF1AEC (updatedBy_id), PRIMARY KEY(id)) ENGINE = InnoDB");
$this->addSql("ALTER TABLE documents ADD CONSTRAINT FK_A2B07288B03A8386 FOREIGN KEY (created_by_id) REFERENCES users (id)"); $this->addSql("ALTER TABLE documents ADD CONSTRAINT FK_A2B07288B03A8386 FOREIGN KEY (created_by_id) REFERENCES users (id)");
$this->addSql("ALTER TABLE documents ADD CONSTRAINT FK_A2B0728865FF1AEC FOREIGN KEY (updatedBy_id) REFERENCES users (id)"); $this->addSql("ALTER TABLE documents ADD CONSTRAINT FK_A2B0728865FF1AEC FOREIGN KEY (updatedBy_id) REFERENCES users (id)");
$this->addSql("CREATE TABLE groups (id INT AUTO_INCREMENT NOT NULL, leader_id INT DEFAULT NULL, created_by_id INT DEFAULT NULL, name VARCHAR(50) NOT NULL, slug VARCHAR(50) NOT NULL, created_at DATETIME NOT NULL, description LONGTEXT DEFAULT NULL, open TINYINT(1) NOT NULL, UNIQUE INDEX UNIQ_F06D39705E237E06 (name), UNIQUE INDEX UNIQ_F06D3970989D9B62 (slug), INDEX IDX_F06D397073154ED4 (leader_id), INDEX IDX_F06D3970B03A8386 (created_by_id), PRIMARY KEY(id)) ENGINE = InnoDB"); $this->addSql("CREATE TABLE groups (id INT AUTO_INCREMENT NOT NULL, leader_id INT DEFAULT NULL, created_by_id INT DEFAULT NULL, name VARCHAR(50) NOT NULL, slug VARCHAR(50) NOT NULL, created_at DATETIME NOT NULL, description LONGTEXT DEFAULT NULL, open TINYINT(1) NOT NULL, UNIQUE INDEX UNIQ_F06D39705E237E06 (name), UNIQUE INDEX UNIQ_F06D3970989D9B62 (slug), INDEX IDX_F06D397073154ED4 (leader_id), INDEX IDX_F06D3970B03A8386 (created_by_id), PRIMARY KEY(id)) ENGINE = InnoDB");
$this->addSql("ALTER TABLE groups ADD CONSTRAINT FK_F06D397073154ED4 FOREIGN KEY (leader_id) REFERENCES users (id)"); $this->addSql("ALTER TABLE groups ADD CONSTRAINT FK_F06D397073154ED4 FOREIGN KEY (leader_id) REFERENCES users (id)");
$this->addSql("ALTER TABLE groups ADD CONSTRAINT FK_F06D3970B03A8386 FOREIGN KEY (created_by_id) REFERENCES users (id)"); $this->addSql("ALTER TABLE groups ADD CONSTRAINT FK_F06D3970B03A8386 FOREIGN KEY (created_by_id) REFERENCES users (id)");
$this->addSql("CREATE TABLE user_group_memberships (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, group_id INT DEFAULT NULL, membership_accepted_by_id INT DEFAULT NULL, membership_requested_at DATETIME NOT NULL, membership_accepted_at DATETIME DEFAULT NULL, INDEX IDX_5BFDE39CA76ED395 (user_id), INDEX IDX_5BFDE39CFE54D947 (group_id), INDEX IDX_5BFDE39C768D2C12 (membership_accepted_by_id), UNIQUE INDEX UNIQ_5BFDE39CA76ED395FE54D947 (user_id, group_id), PRIMARY KEY(id)) ENGINE = InnoDB"); $this->addSql("CREATE TABLE user_group_memberships (id INT AUTO_INCREMENT NOT NULL, user_id INT DEFAULT NULL, group_id INT DEFAULT NULL, membership_accepted_by_id INT DEFAULT NULL, membership_requested_at DATETIME NOT NULL, membership_accepted_at DATETIME DEFAULT NULL, INDEX IDX_5BFDE39CA76ED395 (user_id), INDEX IDX_5BFDE39CFE54D947 (group_id), INDEX IDX_5BFDE39C768D2C12 (membership_accepted_by_id), UNIQUE INDEX UNIQ_5BFDE39CA76ED395FE54D947 (user_id, group_id), PRIMARY KEY(id)) ENGINE = InnoDB");
$this->addSql("ALTER TABLE user_group_memberships ADD CONSTRAINT FK_5BFDE39CA76ED395 FOREIGN KEY (user_id) REFERENCES users (id)"); $this->addSql("ALTER TABLE user_group_memberships ADD CONSTRAINT FK_5BFDE39CA76ED395 FOREIGN KEY (user_id) REFERENCES users (id)");
$this->addSql("ALTER TABLE user_group_memberships ADD CONSTRAINT FK_5BFDE39CFE54D947 FOREIGN KEY (group_id) REFERENCES groups (id)"); $this->addSql("ALTER TABLE user_group_memberships ADD CONSTRAINT FK_5BFDE39CFE54D947 FOREIGN KEY (group_id) REFERENCES groups (id)");
$this->addSql("ALTER TABLE user_group_memberships ADD CONSTRAINT FK_5BFDE39C768D2C12 FOREIGN KEY (membership_accepted_by_id) REFERENCES users (id)"); $this->addSql("ALTER TABLE user_group_memberships ADD CONSTRAINT FK_5BFDE39C768D2C12 FOREIGN KEY (membership_accepted_by_id) REFERENCES users (id)");
$this->addSql("CREATE TABLE group_document (group_id INT NOT NULL, document_id INT NOT NULL, INDEX IDX_D159C609FE54D947 (group_id), INDEX IDX_D159C609C33F7837 (document_id), PRIMARY KEY(group_id, document_id)) ENGINE = InnoDB"); $this->addSql("CREATE TABLE group_document (group_id INT NOT NULL, document_id INT NOT NULL, INDEX IDX_D159C609FE54D947 (group_id), INDEX IDX_D159C609C33F7837 (document_id), PRIMARY KEY(group_id, document_id)) ENGINE = InnoDB");
$this->addSql("ALTER TABLE group_document ADD CONSTRAINT FK_D159C609FE54D947 FOREIGN KEY (group_id) REFERENCES groups (id)"); $this->addSql("ALTER TABLE group_document ADD CONSTRAINT FK_D159C609FE54D947 FOREIGN KEY (group_id) REFERENCES groups (id)");
$this->addSql("ALTER TABLE group_document ADD CONSTRAINT FK_D159C609C33F7837 FOREIGN KEY (document_id) REFERENCES documents (id)"); $this->addSql("ALTER TABLE group_document ADD CONSTRAINT FK_D159C609C33F7837 FOREIGN KEY (document_id) REFERENCES documents (id)");
$this->addSql("CREATE TABLE articles (id INT AUTO_INCREMENT NOT NULL, created_by_id INT DEFAULT NULL, created_at DATETIME NOT NULL, title VARCHAR(100) NOT NULL, slug VARCHAR(100) NOT NULL, text LONGTEXT NOT NULL, main_page TINYINT(1) NOT NULL, public TINYINT(1) NOT NULL, source VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_BFDD31682B36786B (title), UNIQUE INDEX UNIQ_BFDD3168989D9B62 (slug), INDEX IDX_BFDD3168B03A8386 (created_by_id), PRIMARY KEY(id)) ENGINE = InnoDB"); $this->addSql("CREATE TABLE articles (id INT AUTO_INCREMENT NOT NULL, created_by_id INT DEFAULT NULL, created_at DATETIME NOT NULL, title VARCHAR(100) NOT NULL, slug VARCHAR(100) NOT NULL, text LONGTEXT NOT NULL, main_page TINYINT(1) NOT NULL, public TINYINT(1) NOT NULL, source VARCHAR(255) DEFAULT NULL, UNIQUE INDEX UNIQ_BFDD31682B36786B (title), UNIQUE INDEX UNIQ_BFDD3168989D9B62 (slug), INDEX IDX_BFDD3168B03A8386 (created_by_id), PRIMARY KEY(id)) ENGINE = InnoDB");
$this->addSql("ALTER TABLE articles ADD CONSTRAINT FK_BFDD3168B03A8386 FOREIGN KEY (created_by_id) REFERENCES users (id)"); $this->addSql("ALTER TABLE articles ADD CONSTRAINT FK_BFDD3168B03A8386 FOREIGN KEY (created_by_id) REFERENCES users (id)");
$this->addSql("CREATE TABLE forum_topic_groups (id INT AUTO_INCREMENT NOT NULL, created_by_id INT DEFAULT NULL, createdAt DATETIME NOT NULL, slug VARCHAR(100) NOT NULL, title VARCHAR(100) NOT NULL, UNIQUE INDEX UNIQ_6BB4FCEF989D9B62 (slug), UNIQUE INDEX UNIQ_6BB4FCEF2B36786B (title), INDEX IDX_6BB4FCEFB03A8386 (created_by_id), PRIMARY KEY(id)) ENGINE = InnoDB"); $this->addSql("CREATE TABLE forum_topic_groups (id INT AUTO_INCREMENT NOT NULL, created_by_id INT DEFAULT NULL, createdAt DATETIME NOT NULL, slug VARCHAR(100) NOT NULL, title VARCHAR(100) NOT NULL, UNIQUE INDEX UNIQ_6BB4FCEF989D9B62 (slug), UNIQUE INDEX UNIQ_6BB4FCEF2B36786B (title), INDEX IDX_6BB4FCEFB03A8386 (created_by_id), PRIMARY KEY(id)) ENGINE = InnoDB");
$this->addSql("ALTER TABLE forum_topic_groups ADD CONSTRAINT FK_6BB4FCEFB03A8386 FOREIGN KEY (created_by_id) REFERENCES users (id)"); $this->addSql("ALTER TABLE forum_topic_groups ADD CONSTRAINT FK_6BB4FCEFB03A8386 FOREIGN KEY (created_by_id) REFERENCES users (id)");
$this->addSql("CREATE TABLE forum_topics (id INT AUTO_INCREMENT NOT NULL, created_by_id INT DEFAULT NULL, topic_group_id INT DEFAULT NULL, last_post_id INT DEFAULT NULL, created_at DATETIME NOT NULL, slug VARCHAR(100) NOT NULL, title VARCHAR(100) NOT NULL, INDEX IDX_895975E8B03A8386 (created_by_id), INDEX IDX_895975E88655441 (topic_group_id), UNIQUE INDEX UNIQ_895975E82D053F64 (last_post_id), PRIMARY KEY(id)) ENGINE = InnoDB"); $this->addSql("CREATE TABLE forum_topics (id INT AUTO_INCREMENT NOT NULL, created_by_id INT DEFAULT NULL, topic_group_id INT DEFAULT NULL, last_post_id INT DEFAULT NULL, created_at DATETIME NOT NULL, slug VARCHAR(100) NOT NULL, title VARCHAR(100) NOT NULL, INDEX IDX_895975E8B03A8386 (created_by_id), INDEX IDX_895975E88655441 (topic_group_id), UNIQUE INDEX UNIQ_895975E82D053F64 (last_post_id), PRIMARY KEY(id)) ENGINE = InnoDB");
$this->addSql("ALTER TABLE forum_topics ADD CONSTRAINT FK_895975E8B03A8386 FOREIGN KEY (created_by_id) REFERENCES users (id)"); $this->addSql("ALTER TABLE forum_topics ADD CONSTRAINT FK_895975E8B03A8386 FOREIGN KEY (created_by_id) REFERENCES users (id)");
$this->addSql("ALTER TABLE forum_topics ADD CONSTRAINT FK_895975E88655441 FOREIGN KEY (topic_group_id) REFERENCES forum_topic_groups (id)"); $this->addSql("ALTER TABLE forum_topics ADD CONSTRAINT FK_895975E88655441 FOREIGN KEY (topic_group_id) REFERENCES forum_topic_groups (id)");
$this->addSql("CREATE TABLE forum_posts (id INT AUTO_INCREMENT NOT NULL, created_by_id INT DEFAULT NULL, topic_id INT DEFAULT NULL, created_at DATETIME NOT NULL, text LONGTEXT NOT NULL, INDEX IDX_90291C2DB03A8386 (created_by_id), INDEX IDX_90291C2D1F55203D (topic_id), PRIMARY KEY(id)) ENGINE = InnoDB"); $this->addSql("CREATE TABLE forum_posts (id INT AUTO_INCREMENT NOT NULL, created_by_id INT DEFAULT NULL, topic_id INT DEFAULT NULL, created_at DATETIME NOT NULL, text LONGTEXT NOT NULL, INDEX IDX_90291C2DB03A8386 (created_by_id), INDEX IDX_90291C2D1F55203D (topic_id), PRIMARY KEY(id)) ENGINE = InnoDB");
$this->addSql("ALTER TABLE forum_posts ADD CONSTRAINT FK_90291C2DB03A8386 FOREIGN KEY (created_by_id) REFERENCES users (id)"); $this->addSql("ALTER TABLE forum_posts ADD CONSTRAINT FK_90291C2DB03A8386 FOREIGN KEY (created_by_id) REFERENCES users (id)");
$this->addSql("ALTER TABLE forum_posts ADD CONSTRAINT FK_90291C2D1F55203D FOREIGN KEY (topic_id) REFERENCES forum_topics (id)"); $this->addSql("ALTER TABLE forum_posts ADD CONSTRAINT FK_90291C2D1F55203D FOREIGN KEY (topic_id) REFERENCES forum_topics (id)");
$this->addSql("ALTER TABLE forum_topics ADD CONSTRAINT FK_895975E82D053F64 FOREIGN KEY (last_post_id) REFERENCES forum_posts (id)"); $this->addSql("ALTER TABLE forum_topics ADD CONSTRAINT FK_895975E82D053F64 FOREIGN KEY (last_post_id) REFERENCES forum_posts (id)");
$this->addSql("CREATE TABLE events (id INT AUTO_INCREMENT NOT NULL, created_by_id INT DEFAULT NULL, group_id INT DEFAULT NULL, start_date DATE NOT NULL, end_date DATE DEFAULT NULL, title VARCHAR(150) NOT NULL, slug VARCHAR(150) NOT NULL, description LONGTEXT NOT NULL, cancelled TINYINT(1) NOT NULL, start_time TIME NOT NULL, end_time TIME DEFAULT NULL, INDEX IDX_5387574AB03A8386 (created_by_id), INDEX IDX_5387574AFE54D947 (group_id), PRIMARY KEY(id)) ENGINE = InnoDB"); $this->addSql("CREATE TABLE events (id INT AUTO_INCREMENT NOT NULL, created_by_id INT DEFAULT NULL, group_id INT DEFAULT NULL, start_date DATE NOT NULL, end_date DATE DEFAULT NULL, title VARCHAR(150) NOT NULL, slug VARCHAR(150) NOT NULL, description LONGTEXT NOT NULL, cancelled TINYINT(1) NOT NULL, start_time TIME NOT NULL, end_time TIME DEFAULT NULL, INDEX IDX_5387574AB03A8386 (created_by_id), INDEX IDX_5387574AFE54D947 (group_id), PRIMARY KEY(id)) ENGINE = InnoDB");
$this->addSql("ALTER TABLE events ADD CONSTRAINT FK_5387574AB03A8386 FOREIGN KEY (created_by_id) REFERENCES users (id)"); $this->addSql("ALTER TABLE events ADD CONSTRAINT FK_5387574AB03A8386 FOREIGN KEY (created_by_id) REFERENCES users (id)");
$this->addSql("ALTER TABLE events ADD CONSTRAINT FK_5387574AFE54D947 FOREIGN KEY (group_id) REFERENCES groups (id)"); $this->addSql("ALTER TABLE events ADD CONSTRAINT FK_5387574AFE54D947 FOREIGN KEY (group_id) REFERENCES groups (id)");
$this->addSql("CREATE TABLE event_attendees (event_id INT NOT NULL, user_id INT NOT NULL, INDEX IDX_4E5C551871F7E88B (event_id), INDEX IDX_4E5C5518A76ED395 (user_id), PRIMARY KEY(event_id, user_id)) ENGINE = InnoDB"); $this->addSql("CREATE TABLE event_attendees (event_id INT NOT NULL, user_id INT NOT NULL, INDEX IDX_4E5C551871F7E88B (event_id), INDEX IDX_4E5C5518A76ED395 (user_id), PRIMARY KEY(event_id, user_id)) ENGINE = InnoDB");
$this->addSql("ALTER TABLE event_attendees ADD CONSTRAINT FK_4E5C551871F7E88B FOREIGN KEY (event_id) REFERENCES events (id) ON DELETE CASCADE"); $this->addSql("ALTER TABLE event_attendees ADD CONSTRAINT FK_4E5C551871F7E88B FOREIGN KEY (event_id) REFERENCES events (id) ON DELETE CASCADE");
$this->addSql("ALTER TABLE event_attendees ADD CONSTRAINT FK_4E5C5518A76ED395 FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE"); $this->addSql("ALTER TABLE event_attendees ADD CONSTRAINT FK_4E5C5518A76ED395 FOREIGN KEY (user_id) REFERENCES users (id) ON DELETE CASCADE");
} }
public function down(Schema $schema) public function down(Schema $schema)
{ {
// this down() migration is autogenerated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");
$this->addSql("ALTER TABLE event_attendees DROP FOREIGN KEY FK_4E5C551871F7E88B"); $this->addSql("ALTER TABLE event_attendees DROP FOREIGN KEY FK_4E5C551871F7E88B");
$this->addSql("ALTER TABLE event_attendees DROP FOREIGN KEY FK_4E5C5518A76ED395"); $this->addSql("ALTER TABLE event_attendees DROP FOREIGN KEY FK_4E5C5518A76ED395");
$this->addSql("DROP TABLE event_attendees"); $this->addSql("DROP TABLE event_attendees");
$this->addSql("ALTER TABLE events DROP FOREIGN KEY FK_5387574AB03A8386"); $this->addSql("ALTER TABLE events DROP FOREIGN KEY FK_5387574AB03A8386");
$this->addSql("ALTER TABLE events DROP FOREIGN KEY FK_5387574AFE54D947"); $this->addSql("ALTER TABLE events DROP FOREIGN KEY FK_5387574AFE54D947");
$this->addSql("DROP TABLE events"); $this->addSql("DROP TABLE events");
$this->addSql("ALTER TABLE forum_topics DROP FOREIGN KEY FK_895975E82D053F64"); $this->addSql("ALTER TABLE forum_topics DROP FOREIGN KEY FK_895975E82D053F64");
$this->addSql("ALTER TABLE forum_posts DROP FOREIGN KEY FK_90291C2DB03A8386"); $this->addSql("ALTER TABLE forum_posts DROP FOREIGN KEY FK_90291C2DB03A8386");
$this->addSql("ALTER TABLE forum_posts DROP FOREIGN KEY FK_90291C2D1F55203D"); $this->addSql("ALTER TABLE forum_posts DROP FOREIGN KEY FK_90291C2D1F55203D");
$this->addSql("DROP TABLE forum_posts"); $this->addSql("DROP TABLE forum_posts");
$this->addSql("ALTER TABLE forum_topics DROP FOREIGN KEY FK_895975E8B03A8386"); $this->addSql("ALTER TABLE forum_topics DROP FOREIGN KEY FK_895975E8B03A8386");
$this->addSql("ALTER TABLE forum_topics DROP FOREIGN KEY FK_895975E88655441"); $this->addSql("ALTER TABLE forum_topics DROP FOREIGN KEY FK_895975E88655441");
$this->addSql("DROP TABLE forum_topics"); $this->addSql("DROP TABLE forum_topics");
$this->addSql("ALTER TABLE forum_topic_groups DROP FOREIGN KEY FK_6BB4FCEFB03A8386"); $this->addSql("ALTER TABLE forum_topic_groups DROP FOREIGN KEY FK_6BB4FCEFB03A8386");
$this->addSql("DROP TABLE forum_topic_groups"); $this->addSql("DROP TABLE forum_topic_groups");
$this->addSql("ALTER TABLE articles DROP FOREIGN KEY FK_BFDD3168B03A8386"); $this->addSql("ALTER TABLE articles DROP FOREIGN KEY FK_BFDD3168B03A8386");
$this->addSql("DROP TABLE articles"); $this->addSql("DROP TABLE articles");
$this->addSql("ALTER TABLE group_document DROP FOREIGN KEY FK_D159C609FE54D947"); $this->addSql("ALTER TABLE group_document DROP FOREIGN KEY FK_D159C609FE54D947");
$this->addSql("ALTER TABLE group_document DROP FOREIGN KEY FK_D159C609C33F7837"); $this->addSql("ALTER TABLE group_document DROP FOREIGN KEY FK_D159C609C33F7837");
$this->addSql("DROP TABLE group_document"); $this->addSql("DROP TABLE group_document");
$this->addSql("ALTER TABLE user_group_memberships DROP FOREIGN KEY FK_5BFDE39CA76ED395"); $this->addSql("ALTER TABLE user_group_memberships DROP FOREIGN KEY FK_5BFDE39CA76ED395");
$this->addSql("ALTER TABLE user_group_memberships DROP FOREIGN KEY FK_5BFDE39CFE54D947"); $this->addSql("ALTER TABLE user_group_memberships DROP FOREIGN KEY FK_5BFDE39CFE54D947");
$this->addSql("ALTER TABLE user_group_memberships DROP FOREIGN KEY FK_5BFDE39C768D2C12"); $this->addSql("ALTER TABLE user_group_memberships DROP FOREIGN KEY FK_5BFDE39C768D2C12");
$this->addSql("DROP TABLE user_group_memberships"); $this->addSql("DROP TABLE user_group_memberships");
$this->addSql("ALTER TABLE groups DROP FOREIGN KEY FK_F06D397073154ED4"); $this->addSql("ALTER TABLE groups DROP FOREIGN KEY FK_F06D397073154ED4");
$this->addSql("ALTER TABLE groups DROP FOREIGN KEY FK_F06D3970B03A8386"); $this->addSql("ALTER TABLE groups DROP FOREIGN KEY FK_F06D3970B03A8386");
$this->addSql("DROP TABLE groups"); $this->addSql("DROP TABLE groups");
$this->addSql("ALTER TABLE documents DROP FOREIGN KEY FK_A2B07288B03A8386"); $this->addSql("ALTER TABLE documents DROP FOREIGN KEY FK_A2B07288B03A8386");
$this->addSql("ALTER TABLE documents DROP FOREIGN KEY FK_A2B0728865FF1AEC"); $this->addSql("ALTER TABLE documents DROP FOREIGN KEY FK_A2B0728865FF1AEC");
$this->addSql("DROP TABLE documents"); $this->addSql("DROP TABLE documents");
$this->addSql("ALTER TABLE news DROP FOREIGN KEY FK_1DD39950B03A8386"); $this->addSql("ALTER TABLE news DROP FOREIGN KEY FK_1DD39950B03A8386");
$this->addSql("DROP TABLE news"); $this->addSql("DROP TABLE news");
$this->addSql("ALTER TABLE user_role DROP FOREIGN KEY FK_2DE8C6A3A76ED395"); $this->addSql("ALTER TABLE user_role DROP FOREIGN KEY FK_2DE8C6A3A76ED395");
$this->addSql("ALTER TABLE user_role DROP FOREIGN KEY FK_2DE8C6A3D60322AC"); $this->addSql("ALTER TABLE user_role DROP FOREIGN KEY FK_2DE8C6A3D60322AC");
$this->addSql("DROP TABLE user_role"); $this->addSql("DROP TABLE user_role");
$this->addSql("DROP TABLE roles"); $this->addSql("DROP TABLE roles");
$this->addSql("ALTER TABLE user_data DROP FOREIGN KEY FK_D772BFAAA76ED395"); $this->addSql("ALTER TABLE user_data DROP FOREIGN KEY FK_D772BFAAA76ED395");
$this->addSql("DROP TABLE user_data"); $this->addSql("DROP TABLE user_data");
$this->addSql("ALTER TABLE users DROP FOREIGN KEY FK_1483A5E920F699D9"); $this->addSql("ALTER TABLE users DROP FOREIGN KEY FK_1483A5E920F699D9");
$this->addSql("DROP TABLE users"); $this->addSql("DROP TABLE users");
} }
} }

View File

@ -14,7 +14,7 @@ class Version20120801224533 extends AbstractMigration
{ {
// this up() migration is autogenerated, please modify it to your needs // this up() migration is autogenerated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");
$this->addSql("CREATE TABLE books (id INT AUTO_INCREMENT NOT NULL, author VARCHAR(100) NOT NULL, title VARCHAR(100) NOT NULL, year INT NOT NULL, commentable TINYINT(1) NOT NULL, PRIMARY KEY(id)) ENGINE = InnoDB"); $this->addSql("CREATE TABLE books (id INT AUTO_INCREMENT NOT NULL, author VARCHAR(100) NOT NULL, title VARCHAR(100) NOT NULL, year INT NOT NULL, commentable TINYINT(1) NOT NULL, PRIMARY KEY(id)) ENGINE = InnoDB");
$this->addSql("CREATE TABLE book_copies (id INT AUTO_INCREMENT NOT NULL, book_id INT NOT NULL, owner_id INT NOT NULL, borrower_id INT DEFAULT NULL, owner_comment LONGTEXT DEFAULT NULL, borrowable TINYINT(1) NOT NULL, buyable TINYINT(1) NOT NULL, borrower_returned TINYINT(1) NOT NULL, INDEX IDX_F0A8D81116A2B381 (book_id), INDEX IDX_F0A8D8117E3C61F9 (owner_id), UNIQUE INDEX UNIQ_F0A8D81111CE312B (borrower_id), UNIQUE INDEX UNIQ_F0A8D8117E3C61F916A2B381 (owner_id, book_id), PRIMARY KEY(id)) ENGINE = InnoDB"); $this->addSql("CREATE TABLE book_copies (id INT AUTO_INCREMENT NOT NULL, book_id INT NOT NULL, owner_id INT NOT NULL, borrower_id INT DEFAULT NULL, owner_comment LONGTEXT DEFAULT NULL, borrowable TINYINT(1) NOT NULL, buyable TINYINT(1) NOT NULL, borrower_returned TINYINT(1) NOT NULL, INDEX IDX_F0A8D81116A2B381 (book_id), INDEX IDX_F0A8D8117E3C61F9 (owner_id), UNIQUE INDEX UNIQ_F0A8D81111CE312B (borrower_id), UNIQUE INDEX UNIQ_F0A8D8117E3C61F916A2B381 (owner_id, book_id), PRIMARY KEY(id)) ENGINE = InnoDB");
$this->addSql("ALTER TABLE book_copies ADD CONSTRAINT FK_F0A8D81116A2B381 FOREIGN KEY (book_id) REFERENCES books (id)"); $this->addSql("ALTER TABLE book_copies ADD CONSTRAINT FK_F0A8D81116A2B381 FOREIGN KEY (book_id) REFERENCES books (id)");
@ -26,7 +26,7 @@ class Version20120801224533 extends AbstractMigration
{ {
// this down() migration is autogenerated, please modify it to your needs // this down() migration is autogenerated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");
$this->addSql("ALTER TABLE book_copies DROP FOREIGN KEY FK_F0A8D81116A2B381"); $this->addSql("ALTER TABLE book_copies DROP FOREIGN KEY FK_F0A8D81116A2B381");
$this->addSql("DROP TABLE books"); $this->addSql("DROP TABLE books");
$this->addSql("DROP TABLE book_copies"); $this->addSql("DROP TABLE book_copies");

View File

@ -14,7 +14,7 @@ class Version20120806165106 extends AbstractMigration
{ {
// this up() migration is autogenerated, please modify it to your needs // this up() migration is autogenerated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");
$this->addSql("CREATE TABLE book_would_borrow (book_id INT NOT NULL, user_id INT NOT NULL, INDEX IDX_7ED804D216A2B381 (book_id), INDEX IDX_7ED804D2A76ED395 (user_id), PRIMARY KEY(book_id, user_id)) ENGINE = InnoDB"); $this->addSql("CREATE TABLE book_would_borrow (book_id INT NOT NULL, user_id INT NOT NULL, INDEX IDX_7ED804D216A2B381 (book_id), INDEX IDX_7ED804D2A76ED395 (user_id), PRIMARY KEY(book_id, user_id)) ENGINE = InnoDB");
$this->addSql("CREATE TABLE book_would_buy (book_id INT NOT NULL, user_id INT NOT NULL, INDEX IDX_67D6BB5216A2B381 (book_id), INDEX IDX_67D6BB52A76ED395 (user_id), PRIMARY KEY(book_id, user_id)) ENGINE = InnoDB"); $this->addSql("CREATE TABLE book_would_buy (book_id INT NOT NULL, user_id INT NOT NULL, INDEX IDX_67D6BB5216A2B381 (book_id), INDEX IDX_67D6BB52A76ED395 (user_id), PRIMARY KEY(book_id, user_id)) ENGINE = InnoDB");
$this->addSql("ALTER TABLE book_would_borrow ADD CONSTRAINT FK_7ED804D216A2B381 FOREIGN KEY (book_id) REFERENCES books (id) ON DELETE CASCADE"); $this->addSql("ALTER TABLE book_would_borrow ADD CONSTRAINT FK_7ED804D216A2B381 FOREIGN KEY (book_id) REFERENCES books (id) ON DELETE CASCADE");
@ -27,7 +27,7 @@ class Version20120806165106 extends AbstractMigration
{ {
// this down() migration is autogenerated, please modify it to your needs // this down() migration is autogenerated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");
$this->addSql("DROP TABLE book_would_borrow"); $this->addSql("DROP TABLE book_would_borrow");
$this->addSql("DROP TABLE book_would_buy"); $this->addSql("DROP TABLE book_would_buy");
} }

View File

@ -14,7 +14,7 @@ class Version20120815091637 extends AbstractMigration
{ {
// this up() migration is autogenerated, please modify it to your needs // this up() migration is autogenerated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");
$this->addSql("CREATE TABLE role_hierarchy (parent_role_id INT NOT NULL, child_role_id INT NOT NULL, INDEX IDX_AB8EFB72A44B56EA (parent_role_id), INDEX IDX_AB8EFB72B4B76AB7 (child_role_id), PRIMARY KEY(parent_role_id, child_role_id)) ENGINE = InnoDB"); $this->addSql("CREATE TABLE role_hierarchy (parent_role_id INT NOT NULL, child_role_id INT NOT NULL, INDEX IDX_AB8EFB72A44B56EA (parent_role_id), INDEX IDX_AB8EFB72B4B76AB7 (child_role_id), PRIMARY KEY(parent_role_id, child_role_id)) ENGINE = InnoDB");
$this->addSql("ALTER TABLE role_hierarchy ADD CONSTRAINT FK_AB8EFB72A44B56EA FOREIGN KEY (parent_role_id) REFERENCES roles (id)"); $this->addSql("ALTER TABLE role_hierarchy ADD CONSTRAINT FK_AB8EFB72A44B56EA FOREIGN KEY (parent_role_id) REFERENCES roles (id)");
$this->addSql("ALTER TABLE role_hierarchy ADD CONSTRAINT FK_AB8EFB72B4B76AB7 FOREIGN KEY (child_role_id) REFERENCES roles (id)"); $this->addSql("ALTER TABLE role_hierarchy ADD CONSTRAINT FK_AB8EFB72B4B76AB7 FOREIGN KEY (child_role_id) REFERENCES roles (id)");
@ -25,7 +25,7 @@ class Version20120815091637 extends AbstractMigration
{ {
// this down() migration is autogenerated, please modify it to your needs // this down() migration is autogenerated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql"); $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql");
$this->addSql("DROP TABLE role_hierarchy"); $this->addSql("DROP TABLE role_hierarchy");
$this->addSql("ALTER TABLE roles ADD admin TINYINT(1) NOT NULL, ADD superAdmin TINYINT(1) NOT NULL"); $this->addSql("ALTER TABLE roles ADD admin TINYINT(1) NOT NULL, ADD superAdmin TINYINT(1) NOT NULL");
} }

View File

@ -38,11 +38,11 @@ class Requirement
/** /**
* Constructor that initializes the requirement. * Constructor that initializes the requirement.
* *
* @param Boolean $fulfilled Whether the requirement is fulfilled * @param Boolean $fulfilled Whether the requirement is fulfilled
* @param string $testMessage The message for testing the requirement * @param string $testMessage The message for testing the requirement
* @param string $helpHtml The help text formatted in HTML for resolving the problem * @param string $helpHtml The help text formatted in HTML for resolving the problem
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
* @param Boolean $optional Whether this is only an optional recommendation not a mandatory requirement * @param Boolean $optional Whether this is only an optional recommendation not a mandatory requirement
*/ */
public function __construct($fulfilled, $testMessage, $helpHtml, $helpText = null, $optional = false) public function __construct($fulfilled, $testMessage, $helpHtml, $helpText = null, $optional = false)
{ {
@ -114,16 +114,16 @@ class PhpIniRequirement extends Requirement
/** /**
* Constructor that initializes the requirement. * Constructor that initializes the requirement.
* *
* @param string $cfgName The configuration name used for ini_get() * @param string $cfgName The configuration name used for ini_get()
* @param Boolean|callback $evaluation Either a Boolean indicating whether the configuration should evaluate to true or false, * @param Boolean|callback $evaluation Either a Boolean indicating whether the configuration should evaluate to true or false,
or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
* @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. * @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
Example: You require a config to be true but PHP later removes this config and defaults it to true internally. Example: You require a config to be true but PHP later removes this config and defaults it to true internally.
* @param string $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived) * @param string $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived)
* @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived) * @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived)
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
* @param Boolean $optional Whether this is only an optional recommendation not a mandatory requirement * @param Boolean $optional Whether this is only an optional recommendation not a mandatory requirement
*/ */
public function __construct($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null, $optional = false) public function __construct($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null, $optional = false)
{ {
@ -194,10 +194,10 @@ class RequirementCollection implements IteratorAggregate
/** /**
* Adds a mandatory requirement. * Adds a mandatory requirement.
* *
* @param Boolean $fulfilled Whether the requirement is fulfilled * @param Boolean $fulfilled Whether the requirement is fulfilled
* @param string $testMessage The message for testing the requirement * @param string $testMessage The message for testing the requirement
* @param string $helpHtml The help text formatted in HTML for resolving the problem * @param string $helpHtml The help text formatted in HTML for resolving the problem
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
*/ */
public function addRequirement($fulfilled, $testMessage, $helpHtml, $helpText = null) public function addRequirement($fulfilled, $testMessage, $helpHtml, $helpText = null)
{ {
@ -207,10 +207,10 @@ class RequirementCollection implements IteratorAggregate
/** /**
* Adds an optional recommendation. * Adds an optional recommendation.
* *
* @param Boolean $fulfilled Whether the recommendation is fulfilled * @param Boolean $fulfilled Whether the recommendation is fulfilled
* @param string $testMessage The message for testing the recommendation * @param string $testMessage The message for testing the recommendation
* @param string $helpHtml The help text formatted in HTML for resolving the problem * @param string $helpHtml The help text formatted in HTML for resolving the problem
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
*/ */
public function addRecommendation($fulfilled, $testMessage, $helpHtml, $helpText = null) public function addRecommendation($fulfilled, $testMessage, $helpHtml, $helpText = null)
{ {
@ -220,15 +220,15 @@ class RequirementCollection implements IteratorAggregate
/** /**
* Adds a mandatory requirement in form of a php.ini configuration. * Adds a mandatory requirement in form of a php.ini configuration.
* *
* @param string $cfgName The configuration name used for ini_get() * @param string $cfgName The configuration name used for ini_get()
* @param Boolean|callback $evaluation Either a Boolean indicating whether the configuration should evaluate to true or false, * @param Boolean|callback $evaluation Either a Boolean indicating whether the configuration should evaluate to true or false,
or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
* @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. * @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
Example: You require a config to be true but PHP later removes this config and defaults it to true internally. Example: You require a config to be true but PHP later removes this config and defaults it to true internally.
* @param string $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived) * @param string $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived)
* @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived) * @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived)
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
*/ */
public function addPhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null) public function addPhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null)
{ {
@ -238,15 +238,15 @@ class RequirementCollection implements IteratorAggregate
/** /**
* Adds an optional recommendation in form of a php.ini configuration. * Adds an optional recommendation in form of a php.ini configuration.
* *
* @param string $cfgName The configuration name used for ini_get() * @param string $cfgName The configuration name used for ini_get()
* @param Boolean|callback $evaluation Either a Boolean indicating whether the configuration should evaluate to true or false, * @param Boolean|callback $evaluation Either a Boolean indicating whether the configuration should evaluate to true or false,
or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
* @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. * @param Boolean $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
Example: You require a config to be true but PHP later removes this config and defaults it to true internally. Example: You require a config to be true but PHP later removes this config and defaults it to true internally.
* @param string $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived) * @param string $testMessage The message for testing the requirement (when null and $evaluation is a Boolean a default message is derived)
* @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived) * @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a Boolean a default help is derived)
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags) * @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
*/ */
public function addPhpIniRecommendation($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null) public function addPhpIniRecommendation($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null)
{ {

View File

@ -12,4 +12,3 @@ KekRozsakFrontBundle:
KekRozsakSecurityBundle: KekRozsakSecurityBundle:
resource: "@KekRozsakSecurityBundle/Controller/" resource: "@KekRozsakSecurityBundle/Controller/"
type: annotation type: annotation

View File

@ -69,7 +69,6 @@ class DefaultController extends Controller
public function groupJoinDeclineAction() public function groupJoinDeclineAction()
{ {
// TODO: A reason must be written to decline a join request! // TODO: A reason must be written to decline a join request!
return array( return array(
); );
} }

View File

@ -23,7 +23,6 @@ class Configuration implements ConfigurationInterface
// Here you should define the parameters that are allowed to // Here you should define the parameters that are allowed to
// configure your bundle. See the documentation linked above for // configure your bundle. See the documentation linked above for
// more information on that topic. // more information on that topic.
return $treeBuilder; return $treeBuilder;
} }
} }

View File

@ -32,6 +32,8 @@ class BookController extends Controller
* @Route("/konyvadat/{id}/ajax.{_format}", name="KekRozsakFrontBundle_bookAjaxData", defaults={"_format": "html"}, options={"expose": true}) * @Route("/konyvadat/{id}/ajax.{_format}", name="KekRozsakFrontBundle_bookAjaxData", defaults={"_format": "html"}, options={"expose": true})
* @Template() * @Template()
* @ParamConverter("book") * @ParamConverter("book")
*
* @param KekRozsak\FrontBundle\Entity\Book $book
*/ */
public function ajaxDataAction(Book $book) public function ajaxDataAction(Book $book)
{ {
@ -43,13 +45,14 @@ class BookController extends Controller
/** /**
* @Route("/konyv/torles/{id}", name="KekRozsakFrontBundle_bookDeleteCopy", requirements={"id": "\d+"}, options={"expose": true}) * @Route("/konyv/torles/{id}", name="KekRozsakFrontBundle_bookDeleteCopy", requirements={"id": "\d+"}, options={"expose": true})
* @ParamConverter("book") * @ParamConverter("book")
*
* @param KekRozsak\FrontBundle\Entity\Book $book
*/ */
public function ajaxDeleteBookAction(Book $book) public function ajaxDeleteBookAction(Book $book)
{ {
$copies = $book->getUsersCopies($this->get('security.context')->getToken()->getUser()); $copies = $book->getUsersCopies($this->get('security.context')->getToken()->getUser());
$em = $this->getDoctrine()->getEntityManager(); $em = $this->getDoctrine()->getEntityManager();
$copies->forAll(function($key, $copy) use ($book, $em) $copies->forAll(function($key, $copy) use ($book, $em) {
{
$book->removeCopy($copy); $book->removeCopy($copy);
$em->remove($copy); $em->remove($copy);
}); });
@ -62,6 +65,8 @@ class BookController extends Controller
/** /**
* @Route("/konyv/ujpeldany/{id}", name="KekRozsakFrontBundle_bookAddCopy", requirements={"id": "\d+"}, options={"expose": true}) * @Route("/konyv/ujpeldany/{id}", name="KekRozsakFrontBundle_bookAddCopy", requirements={"id": "\d+"}, options={"expose": true})
* @ParamConverter("book") * @ParamConverter("book")
*
* @param KekRozsak\FrontBundle\Entity\Book $book
*/ */
public function ajaxAddCopyAction(Book $book) public function ajaxAddCopyAction(Book $book)
{ {
@ -80,14 +85,16 @@ class BookController extends Controller
/** /**
* @Route("/konyv/kolcsonozheto/{id}/{newValue}", name="KekRozsakFrontBundle_bookSetCopyBorrowable", requirements={"id": "\d+"}, options={"expose": true}) * @Route("/konyv/kolcsonozheto/{id}/{newValue}", name="KekRozsakFrontBundle_bookSetCopyBorrowable", requirements={"id": "\d+"}, options={"expose": true})
* @ParamConverter("book") * @ParamConverter("book")
*
* @param KekRozsak\FrontBundle\Entity\Book $book
* @param boolean $newValue
*/ */
public function ajaxSetBookCopyBorrowableAction(Book $book, $newValue) public function ajaxSetBookCopyBorrowableAction(Book $book, $newValue)
{ {
$user = $this->get('security.context')->getToken()->getUser(); $user = $this->get('security.context')->getToken()->getUser();
$copies = $book->getUsersCopies($user); $copies = $book->getUsersCopies($user);
$em = $this->getDoctrine()->getEntityManager(); $em = $this->getDoctrine()->getEntityManager();
$copies->forAll(function($key, $copy) use ($em, $newValue) $copies->forAll(function($key, $copy) use ($em, $newValue) {
{
$copy->setBorrowable($newValue); $copy->setBorrowable($newValue);
$em->persist($copy); $em->persist($copy);
}); });
@ -99,14 +106,16 @@ class BookController extends Controller
/** /**
* @Route("/konyv/megveheto/{id}/{newValue}", name="KekRozsakFrontBundle_bookSetCopyForSale", requirements={"id": "\d+"}, options={"expose": true}) * @Route("/konyv/megveheto/{id}/{newValue}", name="KekRozsakFrontBundle_bookSetCopyForSale", requirements={"id": "\d+"}, options={"expose": true})
* @ParamConverter("book") * @ParamConverter("book")
*
* @param KekRozsak\FrontBundle\Entity\Book $book
* @param boolean $newValue
*/ */
public function ajaxSetBookCopyForSaleAction(Book $book, $newValue) public function ajaxSetBookCopyForSaleAction(Book $book, $newValue)
{ {
$user = $this->get('security.context')->getToken()->getUser(); $user = $this->get('security.context')->getToken()->getUser();
$copies = $book->getUsersCopies($user); $copies = $book->getUsersCopies($user);
$em = $this->getDoctrine()->getEntityManager(); $em = $this->getDoctrine()->getEntityManager();
$copies->forAll(function($key, $copy) use ($em, $newValue) $copies->forAll(function($key, $copy) use ($em, $newValue) {
{
$copy->setBuyable($newValue); $copy->setBuyable($newValue);
$em->persist($copy); $em->persist($copy);
}); });
@ -118,6 +127,9 @@ class BookController extends Controller
/** /**
* @Route("/konyv/szeretnek/{id}/{wantToBuy}", name="KekRozsakFrontBundle_bookWantOne", requirements={"id": "\d+"}, options={"expose": true}) * @Route("/konyv/szeretnek/{id}/{wantToBuy}", name="KekRozsakFrontBundle_bookWantOne", requirements={"id": "\d+"}, options={"expose": true})
* @ParamConverter("book") * @ParamConverter("book")
*
* @param KekRozsak\FrontBundle\Entity\Book $book
* @param boolean $wantToBuy
*/ */
public function ajaxWantABookAction(Book $book, $wantToBuy) public function ajaxWantABookAction(Book $book, $wantToBuy)
{ {

View File

@ -5,10 +5,7 @@ namespace KekRozsak\FrontBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use KekRozsak\FrontBundle\Entity\UserGroupMembership;
use KekRozsak\FrontBundle\Entity\UserData;
use KekRozsak\FrontBundle\Entity\Article; use KekRozsak\FrontBundle\Entity\Article;
use KekRozsak\SecurityBundle\Form\Type\UserType; use KekRozsak\SecurityBundle\Form\Type\UserType;

View File

@ -17,6 +17,9 @@ class DocumentController extends Controller
* @Route("/dokumentum/{slug}.{_format}", name="KekRozsakFrontBundle_documentView", defaults={"_format": "html"}, requirements={"_format": "html|pdf"}) * @Route("/dokumentum/{slug}.{_format}", name="KekRozsakFrontBundle_documentView", defaults={"_format": "html"}, requirements={"_format": "html|pdf"})
* @Template() * @Template()
* @ParamConverter("document") * @ParamConverter("document")
*
* @param KekRozsak\FrontBundle\Entity\Document $document
* @param string $_format
*/ */
public function viewAction(Document $document, $_format) public function viewAction(Document $document, $_format)
{ {
@ -29,6 +32,7 @@ class DocumentController extends Controller
'KekRozsakFrontBundle:Document:pdfView.html.twig', 'KekRozsakFrontBundle:Document:pdfView.html.twig',
$templateParams $templateParams
); );
return $this->get('io_tcpdf')->quick_pdf($html); return $this->get('io_tcpdf')->quick_pdf($html);
} }
@ -78,6 +82,8 @@ class DocumentController extends Controller
* @Route("/dokumentum/{slug}/szerkesztes", name="KekRozsakFrontBundle_documentEdit") * @Route("/dokumentum/{slug}/szerkesztes", name="KekRozsakFrontBundle_documentEdit")
* @Template() * @Template()
* @ParamConverter("document") * @ParamConverter("document")
*
* @param KekRozsak\FrontBundle\Entity\Document $document
*/ */
public function editAction(Document $document) public function editAction(Document $document)
{ {

View File

@ -17,6 +17,10 @@ class EventController extends Controller
* @Template() * @Template()
* @ParamConverter("event", class="KekRozsakFrontBundle:Event", options={"mapping"={"eventSlug" = "slug", "startDate"="startDate"}}) * @ParamConverter("event", class="KekRozsakFrontBundle:Event", options={"mapping"={"eventSlug" = "slug", "startDate"="startDate"}})
* @ParamConverter("startDate", class="DateTime", options={"format"="Y-m-d"}) * @ParamConverter("startDate", class="DateTime", options={"format"="Y-m-d"})
*
* @param DateTime $startDate
* @param KekRozsak\FrontBundle\Entity\Event $event
* @return array
*/ */
public function viewAction(\DateTime $startDate, Event $event) public function viewAction(\DateTime $startDate, Event $event)
{ {
@ -36,6 +40,10 @@ class EventController extends Controller
* @Template() * @Template()
* @ParamConverter("event", class="KekRozsakFrontBundle:Event", options={"mapping"={"eventSlug": "slug", "startDate": "startDate"}}) * @ParamConverter("event", class="KekRozsakFrontBundle:Event", options={"mapping"={"eventSlug": "slug", "startDate": "startDate"}})
* @ParamConverter("startDate", class="DateTime", options={"format"="Y-m-d"}) * @ParamConverter("startDate", class="DateTime", options={"format"="Y-m-d"})
*
* @param DateTime $startDate
* @param KekRozsak\FrontBundle\Entity\Event $event
* @return array
*/ */
public function joinAction(\DateTime $startDate, Event $event) public function joinAction(\DateTime $startDate, Event $event)
{ {
@ -62,6 +70,9 @@ class EventController extends Controller
/** /**
* @Route("/esemenyek/{date}", name="KekRozsakFrontBundle_eventList", defaults={"date": null}) * @Route("/esemenyek/{date}", name="KekRozsakFrontBundle_eventList", defaults={"date": null})
* @Template() * @Template()
*
* @param string $date
* @return array
*/ */
public function listAction($date = null) public function listAction($date = null)
{ {
@ -87,6 +98,9 @@ class EventController extends Controller
* @Route("/esemenyek/{date}/ajax-lista.{_format}", name="KekRozsakFrontBundle_eventAjaxList", requirements={"_format": "html"}) * @Route("/esemenyek/{date}/ajax-lista.{_format}", name="KekRozsakFrontBundle_eventAjaxList", requirements={"_format": "html"})
* @Template() * @Template()
* @ParamConverter("date", options={"format": "Y-m-d"}) * @ParamConverter("date", options={"format": "Y-m-d"})
*
* @param DateTime $date
* @return array
*/ */
public function ajaxListAction(\DateTime $date) public function ajaxListAction(\DateTime $date)
{ {

View File

@ -37,6 +37,9 @@ class ForumController extends Controller
* @Route("/{slug}", name="KekRozsakFrontBundle_forumTopicList") * @Route("/{slug}", name="KekRozsakFrontBundle_forumTopicList")
* @Template() * @Template()
* @ParamConverter("topicGroup") * @ParamConverter("topicGroup")
*
* @param KekRozsak\FrontBundle\Entity\ForumTopicGroup $topicGroup
* @return array
*/ */
public function topicListAction(ForumTopicgRoup $topicGroup) public function topicListAction(ForumTopicgRoup $topicGroup)
{ {
@ -50,6 +53,10 @@ class ForumController extends Controller
* @Template() * @Template()
* @ParamConverter("topic", options={"mapping"={"topicGroup"="topicGroup", "topicSlug"="slug"}}) * @ParamConverter("topic", options={"mapping"={"topicGroup"="topicGroup", "topicSlug"="slug"}})
* @ParamConverter("topicGroup", options={"mapping"={"topicGroupSlug"="slug"}}) * @ParamConverter("topicGroup", options={"mapping"={"topicGroupSlug"="slug"}})
*
* @param KekRozsak\FrontBundle\Entity\ForumTopicGroup $topicGroup
* @param KekRozsak\FrontBundle\Entity\ForumTopic $topic
* @return array
*/ */
public function postListAction(ForumTopicGroup $topicGroup, ForumTopic $topic) public function postListAction(ForumTopicGroup $topicGroup, ForumTopic $topic)
{ {
@ -88,9 +95,9 @@ class ForumController extends Controller
$this->generateUrl( $this->generateUrl(
'KekRozsakFrontBundle_forumPostList', 'KekRozsakFrontBundle_forumPostList',
array( array(
'topicGroupSlug' => $topicGroup->getSlug(), 'topicGroupSlug' => $topicGroup->getSlug(),
'topicSlug' => $topic->getSlug(), 'topicSlug' => $topic->getSlug(),
) )
) )
); );
} }

View File

@ -19,6 +19,8 @@ class GroupController extends Controller
/** /**
* @Route("/csoportok", name="KekRozsakFrontBundle_groupList") * @Route("/csoportok", name="KekRozsakFrontBundle_groupList")
* @Template() * @Template()
*
* @return array
*/ */
public function listAction() public function listAction()
{ {
@ -36,6 +38,9 @@ class GroupController extends Controller
* @Route("/csoport/{slug}", name="KekRozsakFrontBundle_groupView") * @Route("/csoport/{slug}", name="KekRozsakFrontBundle_groupView")
* @Template() * @Template()
* @ParamConverter("group") * @ParamConverter("group")
*
* @param KekRozsak\FrontBundle\Entity\Group $group
* @return array
*/ */
public function viewAction(Group $group) public function viewAction(Group $group)
{ {
@ -48,6 +53,9 @@ class GroupController extends Controller
* @Route("/csoport/{slug}/tagok", name="KekRozsakFrontBundle_groupMembers") * @Route("/csoport/{slug}/tagok", name="KekRozsakFrontBundle_groupMembers")
* @Template() * @Template()
* @ParamConverter("group") * @ParamConverter("group")
*
* @param KekRozsak\FrontBundle\Entity\Group $group
* @return array
*/ */
public function membersAction(Group $group) public function membersAction(Group $group)
{ {
@ -60,6 +68,9 @@ class GroupController extends Controller
* @Route("/csoport/{slug}/dokumentumok", name="KekRozsakFrontBundle_groupDocuments") * @Route("/csoport/{slug}/dokumentumok", name="KekRozsakFrontBundle_groupDocuments")
* @Template() * @Template()
* @ParamConverter("group") * @ParamConverter("group")
*
* @param KekRozsak\FrontBundle\Entity\Group $group
* @return array
*/ */
public function documentsAction(Group $group) public function documentsAction(Group $group)
{ {
@ -72,6 +83,9 @@ class GroupController extends Controller
* @Route("/csoport/{slug}/belepes", name="KekRozsakFrontBundle_groupJoin") * @Route("/csoport/{slug}/belepes", name="KekRozsakFrontBundle_groupJoin")
* @Template() * @Template()
* @ParamConverter("group") * @ParamConverter("group")
*
* @param KekRozsak\FrontBundle\Entity\Group $group
* @return array
*/ */
public function joinAction(Group $group) public function joinAction(Group $group)
{ {
@ -123,6 +137,8 @@ class GroupController extends Controller
/** /**
* @Route("/csoportok/uj", name="KekRozsakFrontBundle_groupCreate") * @Route("/csoportok/uj", name="KekRozsakFrontBundle_groupCreate")
* @Template() * @Template()
*
* @return array
*/ */
public function createAction() public function createAction()
{ {

View File

@ -5,7 +5,6 @@ namespace KekRozsak\FrontBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
/** /**
* Description of NewsController * Description of NewsController
@ -17,6 +16,8 @@ class NewsController extends Controller
/** /**
* @Route("/newsSideList.html", name="KekRozsakFrontBundle_newsSideList", options={"expose": true}) * @Route("/newsSideList.html", name="KekRozsakFrontBundle_newsSideList", options={"expose": true})
* @Template() * @Template()
*
* @return array
*/ */
public function sideListAction() public function sideListAction()
{ {
@ -26,11 +27,11 @@ class NewsController extends Controller
!is_object($this->get('security.context')->getToken()) !is_object($this->get('security.context')->getToken())
|| !is_object($this->get('security.context')->getToken()->getUser()) || !is_object($this->get('security.context')->getToken()->getUser())
) { ) {
$searchCriteria['public'] = true; $searchCriteria['public'] = true;
} }
$news = $newsRepo->findBy($searchCriteria, array('createdAt' => 'DESC'), 4); $news = $newsRepo->findBy($searchCriteria, array('createdAt' => 'DESC'), 4);
return array( return array(
'recentNews' => $news, 'recentNews' => $news,
); );

View File

@ -23,7 +23,6 @@ class Configuration implements ConfigurationInterface
// Here you should define the parameters that are allowed to // Here you should define the parameters that are allowed to
// configure your bundle. See the documentation linked above for // configure your bundle. See the documentation linked above for
// more information on that topic. // more information on that topic.
return $treeBuilder; return $treeBuilder;
} }
} }

View File

@ -6,7 +6,7 @@ use Doctrine\ORM\Mapping as ORM;
use KekRozsak\SecurityBundle\Entity\User; use KekRozsak\SecurityBundle\Entity\User;
/** /**
* @ORM\Entity * @ORM\Entity
* @ORM\Table(name="articles") * @ORM\Table(name="articles")
*/ */
@ -46,12 +46,13 @@ class Article
/** /**
* Set createdBy * Set createdBy
* *
* @param KekRozsak\SecurityBundle\Entity\User $createdBy * @param KekRozsak\SecurityBundle\Entity\User $createdBy
* @return Article * @return Article
*/ */
public function setCreatedBy(\KekRozsak\SecurityBundle\Entity\User $createdBy) public function setCreatedBy(User $createdBy)
{ {
$this->createdBy = $createdBy; $this->createdBy = $createdBy;
return $this; return $this;
} }
@ -77,12 +78,13 @@ class Article
/** /**
* Set createdAt * Set createdAt
* *
* @param DateTime $createdAt * @param DateTime $createdAt
* @return Article * @return Article
*/ */
public function setCreatedAt(\DateTime $createdAt) public function setCreatedAt(\DateTime $createdAt)
{ {
$this->createdAt = $createdAt; $this->createdAt = $createdAt;
return $this; return $this;
} }
@ -108,12 +110,13 @@ class Article
/** /**
* Set title * Set title
* *
* @param string $title * @param string $title
* @return Article * @return Article
*/ */
public function setTitle($title) public function setTitle($title)
{ {
$this->title = $title; $this->title = $title;
return $this; return $this;
} }
@ -139,12 +142,13 @@ class Article
/** /**
* Set slug * Set slug
* *
* @param string $slug * @param string $slug
* @return Article * @return Article
*/ */
public function setSlug($slug) public function setSlug($slug)
{ {
$this->slug = $slug; $this->slug = $slug;
return $this; return $this;
} }
@ -170,12 +174,13 @@ class Article
/** /**
* Set text * Set text
* *
* @param string $text * @param string $text
* @return Article * @return Article
*/ */
public function setText($text) public function setText($text)
{ {
$this->text = $text; $this->text = $text;
return $this; return $this;
} }
@ -201,12 +206,13 @@ class Article
/** /**
* Set mainPage * Set mainPage
* *
* @param boolean $mainPage * @param boolean $mainPage
* @return Article * @return Article
*/ */
public function setMainPage($mainPage) public function setMainPage($mainPage)
{ {
$this->mainPage = $mainPage; $this->mainPage = $mainPage;
return $this; return $this;
} }
@ -232,12 +238,13 @@ class Article
/** /**
* Set public * Set public
* *
* @param boolean $public * @param boolean $public
* @return Article * @return Article
*/ */
public function setPublic($public = false) public function setPublic($public = false)
{ {
$this->public = $public; $this->public = $public;
return $this; return $this;
} }
@ -263,12 +270,13 @@ class Article
/** /**
* Set source * Set source
* *
* @param string $source * @param string $source
* @return Article * @return Article
*/ */
public function setSource($source = null) public function setSource($source = null)
{ {
$this->source = $source; $this->source = $source;
return $this; return $this;
} }

View File

@ -58,7 +58,7 @@ class Book
/** /**
* Remove a copy * Remove a copy
* *
* @param KekRozsak\FrontBundle\Entity\BookCopy $copy * @param KekRozsak\FrontBundle\Entity\BookCopy $copy
* @return Book * @return Book
*/ */
public function removeCopy(BookCopy $copy) public function removeCopy(BookCopy $copy)
@ -83,8 +83,7 @@ class Book
*/ */
public function getCopiesBorrowed() public function getCopiesBorrowed()
{ {
return $this->copies->filter(function($copy) return $this->copies->filter(function($copy) {
{
return ($copy->getBorrower() !== null); return ($copy->getBorrower() !== null);
}); });
} }
@ -92,13 +91,12 @@ class Book
/** /**
* Get the copies of this Book those are borrowed by $user * Get the copies of this Book those are borrowed by $user
* *
* @param \KekRozsak\SecurityBundle\Entity\User $user * @param KekRozsak\SecurityBundle\Entity\User $user
* @return Doctrine\Common\Collections\ArrayCollection * @return Doctrine\Common\Collections\ArrayCollection
*/ */
public function getCopiesBorrowedByUser(User $user) public function getCopiesBorrowedByUser(User $user)
{ {
return $this->copies->filter(function($copy) use ($user) return $this->copies->filter(function($copy) use ($user) {
{
return ($copy->getBorrower() == $user); return ($copy->getBorrower() == $user);
}); });
} }
@ -107,13 +105,12 @@ class Book
* Get the copies of this Book those are borrowed by $user, but marked as * Get the copies of this Book those are borrowed by $user, but marked as
* returned * returned
* *
* @param \KekRozsak\SecurityBundle\Entity\User $user * @param KekRozsak\SecurityBundle\Entity\User $user
* @return Doctrine\Common\Collections\ArrayCollection * @return Doctrine\Common\Collections\ArrayCollection
*/ */
public function getCopiesBorrowedReturnedByUser(User $user) public function getCopiesBorrowedReturnedByUser(User $user)
{ {
return $this->copies->filter(function($copy) use ($user) return $this->copies->filter(function($copy) use ($user) {
{
return ($copy->getBorrower() == $user) && ($copy->isBorrowerReturned()); return ($copy->getBorrower() == $user) && ($copy->isBorrowerReturned());
}); });
} }
@ -133,13 +130,12 @@ class Book
/** /**
* Get $user's copies of this Book * Get $user's copies of this Book
* *
* @param \KekRozsak\SecurityBundle\Entity\User $user * @param KekRozsak\SecurityBundle\Entity\User $user
* @return Doctrine\Common\Collections\ArrayCollection * @return Doctrine\Common\Collections\ArrayCollection
*/ */
public function getUsersCopies(User $user) public function getUsersCopies(User $user)
{ {
return $this->copies->filter(function ($copy) use ($user) return $this->copies->filter(function ($copy) use ($user) {
{
return ($copy->getOwner() == $user); return ($copy->getOwner() == $user);
}); });
} }
@ -147,13 +143,12 @@ class Book
/** /**
* Get $user's borrowable copies of this Book * Get $user's borrowable copies of this Book
* *
* @param \KekRozsak\SecurityBundle\Entity\User $user * @param KekRozsak\SecurityBundle\Entity\User $user
* @return Doctrine\Common\Collections\ArrayCollection * @return Doctrine\Common\Collections\ArrayCollection
*/ */
public function getUsersCopiesBorrowable(User $user) public function getUsersCopiesBorrowable(User $user)
{ {
return $this->copies->filter(function($copy) use ($user) return $this->copies->filter(function($copy) use ($user) {
{
return (($copy->getOwner() == $user) && $copy->isBorrowable()); return (($copy->getOwner() == $user) && $copy->isBorrowable());
}); });
} }
@ -161,13 +156,12 @@ class Book
/** /**
* Get $user's buyable copies of this Book * Get $user's buyable copies of this Book
* *
* @param \KekRozsak\SecurityBundle\Entity\User $user * @param KekRozsak\SecurityBundle\Entity\User $user
* @return Doctrine\Common\Collections\ArrayCollection * @return Doctrine\Common\Collections\ArrayCollection
*/ */
public function getUsersCopiesBuyable(User $user) public function getUsersCopiesBuyable(User $user)
{ {
return $this->copies->filter(function($copy) use ($user) return $this->copies->filter(function($copy) use ($user) {
{
return (($copy->getOwner() == $user) && $copy->isBuyable()); return (($copy->getOwner() == $user) && $copy->isBuyable());
}); });
} }
@ -184,13 +178,14 @@ class Book
/** /**
* Set author * Set author
* *
* @param string $author * @param string $author
* @return Book * @return Book
*/ */
public function setAuthor($author) public function setAuthor($author)
{ {
// TODO: Check if null! // TODO: Check if null!
$this->author = $author; $this->author = $author;
return $this; return $this;
} }
@ -216,13 +211,14 @@ class Book
/** /**
* Set title * Set title
* *
* @param string $title * @param string $title
* @return Book * @return Book
*/ */
public function setTitle($title) public function setTitle($title)
{ {
// TODO: Check if null! // TODO: Check if null!
$this->title = $title; $this->title = $title;
return $this; return $this;
} }
@ -248,13 +244,14 @@ class Book
/** /**
* Set year * Set year
* *
* @param integer $year * @param integer $year
* @return Book * @return Book
*/ */
public function setYear($year) public function setYear($year)
{ {
// TODO: Check if null! // TODO: Check if null!
$this->year = $year; $this->year = $year;
return $this; return $this;
} }
@ -289,13 +286,14 @@ class Book
/** /**
* Add a user for want-to-borrowers * Add a user for want-to-borrowers
* *
* @param KekRozsak\SecurityBundle\Entity\User $user * @param KekRozsak\SecurityBundle\Entity\User $user
* @return Book * @return Book
*/ */
public function addWouldBorrow(User $user) public function addWouldBorrow(User $user)
{ {
// TODO: Check if null! // TODO: Check if null!
$this->wouldBorrow->add($user); $this->wouldBorrow->add($user);
return $this; return $this;
} }
@ -312,7 +310,7 @@ class Book
/** /**
* Check if $user would like to borrow this book * Check if $user would like to borrow this book
* *
* @param KekRozsak\SecurityBundle\Entity\User $user * @param KekRozsak\SecurityBundle\Entity\User $user
* @return boolean * @return boolean
*/ */
public function userWouldBorrow(User $user) public function userWouldBorrow(User $user)
@ -333,12 +331,13 @@ class Book
/** /**
* Add a user for want-to-buyers * Add a user for want-to-buyers
* *
* @param KekRozsak\SecurityBundle\Entity\User $user * @param KekRozsak\SecurityBundle\Entity\User $user
* @return Book * @return Book
*/ */
public function addWouldBuy(User $user) public function addWouldBuy(User $user)
{ {
$this->wouldBuy->add($user); $this->wouldBuy->add($user);
return $this; return $this;
} }
@ -355,7 +354,7 @@ class Book
/** /**
* Check if specified user would buy this book * Check if specified user would buy this book
* *
* @param KekRozsak\SecurityBundle\Entity\User $user * @param KekRozsak\SecurityBundle\Entity\User $user
* @return boolean * @return boolean
*/ */
public function userWouldBuy(User $user) public function userWouldBuy(User $user)

View File

@ -90,13 +90,14 @@ class BookCopy
/** /**
* Set borrowable * Set borrowable
* *
* @param boolean $borrowable * @param boolean $borrowable
* @return BookCopy * @return BookCopy
*/ */
public function setBorrowable($borrowable) public function setBorrowable($borrowable)
{ {
// TODO: Check if parameter is boolean! // TODO: Check if parameter is boolean!
$this->borrowable = $borrowable; $this->borrowable = $borrowable;
return $this; return $this;
} }
@ -122,13 +123,14 @@ class BookCopy
/** /**
* Set buyable * Set buyable
* *
* @param boolean $buyable * @param boolean $buyable
* @return BookCopy * @return BookCopy
*/ */
public function setBuyable($buyable) public function setBuyable($buyable)
{ {
// Check if parameter is boolean! // Check if parameter is boolean!
$this->buyable = $buyable; $this->buyable = $buyable;
return $this; return $this;
} }

View File

@ -58,12 +58,13 @@ class Document
/** /**
* Set title * Set title
* *
* @param string $title * @param string $title
* @return Document * @return Document
*/ */
public function setTitle($title) public function setTitle($title)
{ {
$this->title = $title; $this->title = $title;
return $this; return $this;
} }
@ -90,12 +91,13 @@ class Document
/** /**
* Set slug * Set slug
* *
* @param string $slug * @param string $slug
* @return Document * @return Document
*/ */
public function setSlug($slug) public function setSlug($slug)
{ {
$this->slug = $slug; $this->slug = $slug;
return $this; return $this;
} }
@ -122,12 +124,13 @@ class Document
/** /**
* Set createdBy * Set createdBy
* *
* @param KekRozsak\SecurityBundle\Entity\User $createdBy * @param KekRozsak\SecurityBundle\Entity\User $createdBy
* @return Document * @return Document
*/ */
public function setCreatedBy(User $createdBy) public function setCreatedBy(User $createdBy)
{ {
$this->createdBy = $createdBy; $this->createdBy = $createdBy;
return $this; return $this;
} }
@ -153,12 +156,13 @@ class Document
/** /**
* Set createdAt * Set createdAt
* *
* @param DateTime $createdAt * @param DateTime $createdAt
* @return Document * @return Document
*/ */
public function setCreatedAt(\DateTime $createdAt) public function setCreatedAt(\DateTime $createdAt)
{ {
$this->createdAt = $createdAt; $this->createdAt = $createdAt;
return $this; return $this;
} }
@ -184,12 +188,13 @@ class Document
/** /**
* Set content * Set content
* *
* @param string $content * @param string $content
* @return Document * @return Document
*/ */
public function setContent($content) public function setContent($content)
{ {
$this->content = $content; $this->content = $content;
return $this; return $this;
} }
@ -212,12 +217,13 @@ class Document
/** /**
* Add a group * Add a group
* *
* @param KekRozsak\FrontBundle\Entity\Group $group * @param KekRozsak\FrontBundle\Entity\Group $group
* @return Document * @return Document
*/ */
public function addGroup(Group $group) public function addGroup(Group $group)
{ {
$this->groups[] = $group; $this->groups[] = $group;
return $this; return $this;
} }
@ -243,12 +249,13 @@ class Document
/** /**
* Set updatedBy * Set updatedBy
* *
* @param KekRozsak\SecurityBundle\Entity\User $updatedBy * @param KekRozsak\SecurityBundle\Entity\User $updatedBy
* @return Document * @return Document
*/ */
public function setUpdatedBy(User $updatedBy = null) public function setUpdatedBy(User $updatedBy = null)
{ {
$this->updatedBy = $updatedBy; $this->updatedBy = $updatedBy;
return $this; return $this;
} }
@ -274,15 +281,16 @@ class Document
/** /**
* Set updatedAt * Set updatedAt
* *
* @param DateTime $updatedAt * @param DateTime $updatedAt
* @return Document * @return Document
*/ */
public function setUpdatedAt(\DateTime $updatedAt = null) public function setUpdatedAt(\DateTime $updatedAt = null)
{ {
$this->updatedAt = $updatedAt; $this->updatedAt = $updatedAt;
return $this; return $this;
} }
/** /**
* Get updatedAt * Get updatedAt
* *
@ -298,19 +306,20 @@ class Document
* @ORM\Column(type="text", nullable=true) * @ORM\Column(type="text", nullable=true)
*/ */
protected $updateReason; protected $updateReason;
/** /**
* Set updateReason * Set updateReason
* *
* @param string $updateReason * @param string $updateReason
* @return Document * @return Document
*/ */
public function setUpdateReason($updateReason = null) public function setUpdateReason($updateReason = null)
{ {
$this->updateReason = $updateReason; $this->updateReason = $updateReason;
return $this; return $this;
} }
/** /**
* Get updateReason * Get updateReason
* *

View File

@ -29,7 +29,7 @@ class Event
* @ORM\Column(type="integer") * @ORM\Column(type="integer")
*/ */
protected $id; protected $id;
/** /**
* Get id * Get id
* *
@ -39,7 +39,7 @@ class Event
{ {
return $this->id; return $this->id;
} }
/** /**
* The User who created the Event * The User who created the Event
* *
@ -49,19 +49,20 @@ class Event
* @ORM\JoinColumn(name="created_by_id") * @ORM\JoinColumn(name="created_by_id")
*/ */
protected $createdBy; protected $createdBy;
/** /**
* Set createdBy * Set createdBy
* *
* @param KekRozsak\SecurityBundle\Entity\User $createdBy * @param KekRozsak\SecurityBundle\Entity\User $createdBy
* @return Event * @return Event
*/ */
public function setCreatedBy(User $createdBy) public function setCreatedBy(User $createdBy)
{ {
$this->createdBy = $createdBy; $this->createdBy = $createdBy;
return $this; return $this;
} }
/** /**
* Get createdBy * Get createdBy
* *
@ -71,7 +72,7 @@ class Event
{ {
return $this->createdBy; return $this->createdBy;
} }
/** /**
* The date on which the Event starts * The date on which the Event starts
* *
@ -80,19 +81,20 @@ class Event
* @ORM\Column(type="date", nullable=true, name="start_date", nullable=false) * @ORM\Column(type="date", nullable=true, name="start_date", nullable=false)
*/ */
protected $startDate; protected $startDate;
/** /**
* Set startDate * Set startDate
* *
* @param DateTime $startDate * @param DateTime $startDate
* @return Event * @return Event
*/ */
public function setStartDate(\DateTime $startDate = null) public function setStartDate(\DateTime $startDate = null)
{ {
$this->startDate = $startDate; $this->startDate = $startDate;
return $this; return $this;
} }
/** /**
* Get startDate * Get startDate
* *
@ -102,7 +104,7 @@ class Event
{ {
return $this->startDate; return $this->startDate;
} }
/** /**
* The date on which the Event ends. May be null if same as $startDate * The date on which the Event ends. May be null if same as $startDate
* *
@ -115,13 +117,14 @@ class Event
/** /**
* Set endDate * Set endDate
* *
* @param DateTime $endDate * @param DateTime $endDate
* @return Event * @return Event
*/ */
public function setEndDate(\DateTime $endDate = null) public function setEndDate(\DateTime $endDate = null)
{ {
// TODO: Check if endDate is later than startDate // TODO: Check if endDate is later than startDate
$this->endDate = $endDate; $this->endDate = $endDate;
return $this; return $this;
} }
@ -148,12 +151,13 @@ class Event
/** /**
* Add attendee * Add attendee
* *
* @param KekRozsak\SecurityBundle\Entity\User $attendee * @param KekRozsak\SecurityBundle\Entity\User $attendee
* @return Event * @return Event
*/ */
public function addAttendee(User $attendee) public function addAttendee(User $attendee)
{ {
$this->attendees[] = $attendee; $this->attendees[] = $attendee;
return $this; return $this;
} }
@ -170,13 +174,12 @@ class Event
/** /**
* Check if a user is attending * Check if a user is attending
* *
* @param KekRozsak\SecurityBundle\Entity\User $user * @param KekRozsak\SecurityBundle\Entity\User $user
* @return boolean * @return boolean
*/ */
public function isAttending(User $user) public function isAttending(User $user)
{ {
$users = $this->attendees->filter(function ($attendee) use ($user) $users = $this->attendees->filter(function ($attendee) use ($user) {
{
if ($attendee == $user) { if ($attendee == $user) {
return true; return true;
} }
@ -199,13 +202,14 @@ class Event
/** /**
* Set title * Set title
* *
* @param string $title * @param string $title
* @return Event * @return Event
*/ */
public function setTitle($title) public function setTitle($title)
{ {
// TODO: Check if empty or null! // TODO: Check if empty or null!
$this->title = $title; $this->title = $title;
return $this; return $this;
} }
@ -233,13 +237,14 @@ class Event
/** /**
* Set slug * Set slug
* *
* @param string $slug * @param string $slug
* @return Event * @return Event
*/ */
public function setSlug($slug) public function setSlug($slug)
{ {
// TODO: Check if empty or null! // TODO: Check if empty or null!
$this->slug = $slug; $this->slug = $slug;
return $this; return $this;
} }
@ -267,13 +272,14 @@ class Event
/** /**
* Set description * Set description
* *
* @param string $description * @param string $description
* @return Event * @return Event
*/ */
public function setDescription($description) public function setDescription($description)
{ {
// TODO: Check if empty! // TODO: Check if empty!
$this->description = $description; $this->description = $description;
return $this; return $this;
} }
@ -297,12 +303,13 @@ class Event
/** /**
* Set group * Set group
* *
* @param KekRozsak\FrontBundle\Entity\Group $group * @param KekRozsak\FrontBundle\Entity\Group $group
* @return Event * @return Event
*/ */
public function setGroup(Group $group = null) public function setGroup(Group $group = null)
{ {
$this->group = $group; $this->group = $group;
return $this; return $this;
} }
@ -328,13 +335,14 @@ class Event
/** /**
* Set cancelled * Set cancelled
* *
* @param boolean $cancelled * @param boolean $cancelled
* @return Event * @return Event
*/ */
public function setCancelled($cancelled = false) public function setCancelled($cancelled = false)
{ {
// TODO: Check if parameter is boolean // TODO: Check if parameter is boolean
$this->cancelled = $cancelled; $this->cancelled = $cancelled;
return $this; return $this;
} }
@ -360,12 +368,13 @@ class Event
/** /**
* Set startTime * Set startTime
* *
* @param DateTime $startTime * @param DateTime $startTime
* @return Event * @return Event
*/ */
public function setStartTime(\DateTime $startTime) public function setStartTime(\DateTime $startTime)
{ {
$this->startTime = $startTime; $this->startTime = $startTime;
return $this; return $this;
} }
@ -391,13 +400,14 @@ class Event
/** /**
* Set endTime * Set endTime
* *
* @param DateTime $endTime * @param DateTime $endTime
* @return Event * @return Event
*/ */
public function setEndTime(\DateTime $endTime = null) public function setEndTime(\DateTime $endTime = null)
{ {
// TODO: Check if endTime is later than startDate + startTime // TODO: Check if endTime is later than startDate + startTime
$this->endTime = $endTime; $this->endTime = $endTime;
return $this; return $this;
} }
@ -414,7 +424,7 @@ class Event
/** /**
* Check if an event will go on a specific date * Check if an event will go on a specific date
* *
* @param DateTime $date * @param DateTime $date
* @return boolean * @return boolean
*/ */
public function isOnDate(\DateTime $date) public function isOnDate(\DateTime $date)
@ -436,7 +446,7 @@ class Event
/** /**
* Check if the event happened before a given date * Check if the event happened before a given date
* *
* @param DateTime $date * @param DateTime $date
* @return boolean * @return boolean
*/ */
public function isPast(\DateTime $date = null) public function isPast(\DateTime $date = null)

View File

@ -40,7 +40,7 @@ class ForumPost
* *
* @var KekRozsak\SecurityBundle\Entity\User $createBy * @var KekRozsak\SecurityBundle\Entity\User $createBy
* *
* @ORM\ManyToOne(targetEntity="\KekRozsak\SecurityBundle\Entity\User") * @ORM\ManyToOne(targetEntity="KekRozsak\SecurityBundle\Entity\User")
* @ORM\JoinColumn(name="created_by_id") * @ORM\JoinColumn(name="created_by_id")
*/ */
protected $createdBy; protected $createdBy;
@ -48,20 +48,21 @@ class ForumPost
/** /**
* Set createdBy * Set createdBy
* *
* @param \KekRozsak\SecurityBundle\Entity\User $createdBy * @param KekRozsak\SecurityBundle\Entity\User $createdBy
* @return ForumPost * @return ForumPost
*/ */
public function setCreatedBy(User $createdBy) public function setCreatedBy(User $createdBy)
{ {
// TODO: Check if null! // TODO: Check if null!
$this->createdBy = $createdBy; $this->createdBy = $createdBy;
return $this; return $this;
} }
/** /**
* Get createdBy * Get createdBy
* *
* @return \KekRozsak\SecurityBundle\Entity\User * @return KekRozsak\SecurityBundle\Entity\User
*/ */
public function getCreatedBy() public function getCreatedBy()
{ {
@ -80,7 +81,7 @@ class ForumPost
/** /**
* Set createdAt * Set createdAt
* *
* @param DateTime $createdAt * @param DateTime $createdAt
* @return ForumPost * @return ForumPost
*/ */
public function setCreatedAt(\DateTime $createdAt) public function setCreatedAt(\DateTime $createdAt)
@ -111,13 +112,14 @@ class ForumPost
/** /**
* Set text * Set text
* *
* @param string $text * @param string $text
* @return ForumPost * @return ForumPost
*/ */
public function setText($text) public function setText($text)
{ {
// TODO: Check if empty or null! // TODO: Check if empty or null!
$this->text = $text; $this->text = $text;
return $this; return $this;
} }
@ -143,7 +145,7 @@ class ForumPost
/** /**
* Set topic * Set topic
* *
* @param ForumTopic $topic * @param ForumTopic $topic
* @return ForumPost * @return ForumPost
*/ */
public function setTopic(ForumTopic $topic) public function setTopic(ForumTopic $topic)
@ -180,6 +182,6 @@ class ForumPost
{ {
if ($this->createdAt === null) { if ($this->createdAt === null) {
$this->createdAt = new \DateTime('now'); $this->createdAt = new \DateTime('now');
} }
} }
} }

View File

@ -59,6 +59,7 @@ class ForumTopic
{ {
// TODO: Check if null! // TODO: Check if null!
$this->createdBy = $createdBy; $this->createdBy = $createdBy;
return $this; return $this;
} }
@ -84,13 +85,14 @@ class ForumTopic
/** /**
* Set createdAt * Set createdAt
* *
* @param DateTime $createdAt * @param DateTime $createdAt
* @return ForumTopic * @return ForumTopic
*/ */
public function setCreatedAt(\DateTime $createdAt) public function setCreatedAt(\DateTime $createdAt)
{ {
// TODO: Check if not null! // TODO: Check if not null!
$this->createdAt = $createdAt; $this->createdAt = $createdAt;
return $this; return $this;
} }
@ -117,13 +119,14 @@ class ForumTopic
/** /**
* Set topicGroup * Set topicGroup
* *
* @param ForumTopicGroup $topicGroup * @param ForumTopicGroup $topicGroup
* @return ForumTopic * @return ForumTopic
*/ */
public function setTopicGroup(ForumTopicGroup $topicGroup) public function setTopicGroup(ForumTopicGroup $topicGroup)
{ {
// TODO: Check if not null! // TODO: Check if not null!
$this->topicGroup = $topicGroup; $this->topicGroup = $topicGroup;
return $this; return $this;
} }
@ -149,13 +152,14 @@ class ForumTopic
/** /**
* Set slug * Set slug
* *
* @param string $slug * @param string $slug
* @return ForumTopic * @return ForumTopic
*/ */
public function setSlug($slug) public function setSlug($slug)
{ {
// TODO: Check if empty or null! // TODO: Check if empty or null!
$this->slug = $slug; $this->slug = $slug;
return $this; return $this;
} }
@ -181,13 +185,14 @@ class ForumTopic
/** /**
* Set title * Set title
* *
* @param string $title * @param string $title
* @return ForumTopic * @return ForumTopic
*/ */
public function setTitle($title) public function setTitle($title)
{ {
// TODO: Check if empty or null! // TODO: Check if empty or null!
$this->title = $title; $this->title = $title;
return $this; return $this;
} }
@ -214,7 +219,7 @@ class ForumTopic
/** /**
* Set lastPost * Set lastPost
* *
* @param ForumPost $lastPost * @param ForumPost $lastPost
* @return ForumTopic * @return ForumTopic
*/ */
public function setLastPost($lastPost = null) public function setLastPost($lastPost = null)
@ -244,13 +249,14 @@ class ForumTopic
/** /**
* Add post * Add post
* *
* @param ForumPost $post * @param ForumPost $post
* @return ForumTopic * @return ForumTopic
*/ */
public function addPost(ForumPost $post) public function addPost(ForumPost $post)
{ {
// TODO: Check if null! // TODO: Check if null!
$this->posts[] = $post; $this->posts[] = $post;
return $this; return $this;
} }

View File

@ -53,13 +53,14 @@ class ForumTopicGroup
/** /**
* Set createdBy * Set createdBy
* *
* @param KekRozsak\SecurityBundle\Entity\User $createdBy * @param KekRozsak\SecurityBundle\Entity\User $createdBy
* @return ForumTopicGroup * @return ForumTopicGroup
*/ */
public function setCreatedBy(User $createdBy) public function setCreatedBy(User $createdBy)
{ {
// TODO: Check if null! // TODO: Check if null!
$this->createdBy = $createdBy; $this->createdBy = $createdBy;
return $this; return $this;
} }
@ -85,13 +86,14 @@ class ForumTopicGroup
/** /**
* Set createdAt * Set createdAt
* *
* @param DateTime $createdAt * @param DateTime $createdAt
* @return ForumTopicGroup * @return ForumTopicGroup
*/ */
public function setCreatedAt(\DateTime $createdAt) public function setCreatedAt(\DateTime $createdAt)
{ {
// TODO: Check if null! // TODO: Check if null!
$this->createdAt = $createdAt; $this->createdAt = $createdAt;
return $this; return $this;
} }
@ -117,13 +119,14 @@ class ForumTopicGroup
/** /**
* Set slug * Set slug
* *
* @param string $slug * @param string $slug
* @return ForumTopicGroup * @return ForumTopicGroup
*/ */
public function setSlug($slug) public function setSlug($slug)
{ {
// TODO: Check if empty or null! // TODO: Check if empty or null!
$this->slug = $slug; $this->slug = $slug;
return $this; return $this;
} }
@ -149,12 +152,13 @@ class ForumTopicGroup
/** /**
* Set title * Set title
* *
* @param string $title * @param string $title
* @return ForumTopicGroup * @return ForumTopicGroup
*/ */
public function setTitle($title) public function setTitle($title)
{ {
$this->title = $title; $this->title = $title;
return $this; return $this;
} }
@ -180,13 +184,14 @@ class ForumTopicGroup
/** /**
* Add topic * Add topic
* *
* @param ForumTopic $topic * @param ForumTopic $topic
* @return ForumTopicGroup * @return ForumTopicGroup
*/ */
public function addTopic(ForumTopic $topic) public function addTopic(ForumTopic $topic)
{ {
// TODO: Check if null! // TODO: Check if null!
$this->topics[] = $topic; $this->topics[] = $topic;
return $this; return $this;
} }

View File

@ -55,12 +55,13 @@ class Group
/** /**
* Set leader * Set leader
* *
* @param KekRozsak\SecurityBundle\Entity\User $leader * @param KekRozsak\SecurityBundle\Entity\User $leader
* @return Group * @return Group
*/ */
public function setLeader(User $leader = null) public function setLeader(User $leader = null)
{ {
$this->leader = $leader; $this->leader = $leader;
return $this; return $this;
} }
@ -88,13 +89,14 @@ class Group
/** /**
* Set name * Set name
* *
* @param string $name * @param string $name
* @return Group * @return Group
*/ */
public function setName($name) public function setName($name)
{ {
// TODO: Check if empty or null! // TODO: Check if empty or null!
$this->name = $name; $this->name = $name;
return $this; return $this;
} }
@ -120,13 +122,14 @@ class Group
/** /**
* Set slug * Set slug
* *
* @param string $slug * @param string $slug
* @return Group * @return Group
*/ */
public function setSlug($slug) public function setSlug($slug)
{ {
// TODO: Check if empty or null! // TODO: Check if empty or null!
$this->slug = $slug; $this->slug = $slug;
return $this; return $this;
} }
@ -153,12 +156,13 @@ class Group
/** /**
* Set createdBy * Set createdBy
* *
* @param KekRozsak\SecurityBundle\Entity\User $createdBy * @param KekRozsak\SecurityBundle\Entity\User $createdBy
* @return Group * @return Group
*/ */
public function setCreatedBy(User $createdBy) public function setCreatedBy(User $createdBy)
{ {
$this->createdBy = $createdBy; $this->createdBy = $createdBy;
return $this; return $this;
} }
@ -184,13 +188,14 @@ class Group
/** /**
* Set createdAt * Set createdAt
* *
* @param DateTime $createdAt * @param DateTime $createdAt
* @return Group * @return Group
*/ */
public function setCreatedAt(\DateTime $createdAt) public function setCreatedAt(\DateTime $createdAt)
{ {
// TODO: Check if null! // TODO: Check if null!
$this->createdAt = $createdAt; $this->createdAt = $createdAt;
return $this; return $this;
} }
@ -217,13 +222,14 @@ class Group
/** /**
* Add member * Add member
* *
* @param KekRozsak\FrontBundle\Entity\UserGroupMembership $member * @param KekRozsak\FrontBundle\Entity\UserGroupMembership $member
* @return Group * @return Group
*/ */
public function addMember(UserGroupMembership $member) public function addMember(UserGroupMembership $member)
{ {
// TODO: Check if null! // TODO: Check if null!
$this->members[] = $member; $this->members[] = $member;
return $this; return $this;
} }
@ -240,13 +246,12 @@ class Group
/** /**
* Check if user is a member of this Group * Check if user is a member of this Group
* *
* @param KekRozsak\SecurityBundle\Entity\User $user * @param KekRozsak\SecurityBundle\Entity\User $user
* @return boolean * @return boolean
*/ */
public function isMember(User $user) public function isMember(User $user)
{ {
return ($this->members->filter(function ($groupMembership) use ($user) return ($this->members->filter(function ($groupMembership) use ($user) {
{
return ( return (
($groupMembership->getUser() == $user) ($groupMembership->getUser() == $user)
&& ( && (
@ -260,13 +265,12 @@ class Group
/** /**
* Check if user already requested a membership in this Group * Check if user already requested a membership in this Group
* *
* @param KekRozsak\SecurityBundle\Entity\User $user * @param KekRozsak\SecurityBundle\Entity\User $user
* @return boolean * @return boolean
*/ */
public function isRequested(User $user) public function isRequested(User $user)
{ {
return ($this->members->filter(function ($groupMembership) use ($user) return ($this->members->filter(function ($groupMembership) use ($user) {
{
return ( return (
($groupMembership->getUser() == $user) ($groupMembership->getUser() == $user)
&& ($groupMembership->getMembershipRequestedAt() !== null) && ($groupMembership->getMembershipRequestedAt() !== null)
@ -286,12 +290,13 @@ class Group
/** /**
* Set description * Set description
* *
* @param string $description * @param string $description
* @return Group * @return Group
*/ */
public function setDescription($description = null) public function setDescription($description = null)
{ {
$this->description = $description; $this->description = $description;
return $this; return $this;
} }
@ -323,6 +328,7 @@ class Group
public function setOpen($open = false) public function setOpen($open = false)
{ {
$this->open = $open; $this->open = $open;
return $this; return $this;
} }
@ -353,16 +359,17 @@ class Group
/** /**
* Add document * Add document
* *
* @param KekRozsak\FrontBundle\Entity\Document $document * @param KekRozsak\FrontBundle\Entity\Document $document
* @return Group * @return Group
*/ */
public function addDocument(Document $document) public function addDocument(Document $document)
{ {
// TODO: Check if null! // TODO: Check if null!
$this->documents[] = $document; $this->documents[] = $document;
return $this; return $this;
} }
/** /**
* Get all documents * Get all documents
* *

View File

@ -45,13 +45,14 @@ class News
/** /**
* Set title * Set title
* *
* @param string $title * @param string $title
* @return News * @return News
*/ */
public function setTitle($title) public function setTitle($title)
{ {
// TODO: Check if empty or null! // TODO: Check if empty or null!
$this->title = $title; $this->title = $title;
return $this; return $this;
} }
@ -77,12 +78,13 @@ class News
/** /**
* Set text * Set text
* *
* @param string $text * @param string $text
* @return News * @return News
*/ */
public function setText($text) public function setText($text)
{ {
$this->text = $text; $this->text = $text;
return $this; return $this;
} }
@ -108,13 +110,14 @@ class News
/** /**
* Set createdAt * Set createdAt
* *
* @param DateTime $createdAt * @param DateTime $createdAt
* @return News * @return News
*/ */
public function setCreatedAt(\DateTime $createdAt) public function setCreatedAt(\DateTime $createdAt)
{ {
// TODO: Check if null! // TODO: Check if null!
$this->createdAt = $createdAt; $this->createdAt = $createdAt;
return $this; return $this;
} }
@ -131,9 +134,9 @@ class News
/** /**
* The User who created this News item * The User who created this News item
* *
* @var \KekRozsak\SecurityBundle\Entity\User $createdBy * @var KekRozsak\SecurityBundle\Entity\User $createdBy
* *
* @ORM\ManyToOne(targetEntity="\KekRozsak\SecurityBundle\Entity\User") * @ORM\ManyToOne(targetEntity="KekRozsak\SecurityBundle\Entity\User")
* @ORM\JoinColumn(name="created_by_id") * @ORM\JoinColumn(name="created_by_id")
*/ */
protected $createdBy; protected $createdBy;
@ -141,20 +144,21 @@ class News
/** /**
* Set createdBy * Set createdBy
* *
* @param \KekRozsak\SecurityBundle\Entity\User $createdBy * @param KekRozsak\SecurityBundle\Entity\User $createdBy
* @return News * @return News
*/ */
public function setCreatedBy(User $createdBy) public function setCreatedBy(User $createdBy)
{ {
// TODO: Check if null! // TODO: Check if null!
$this->createdBy = $createdBy; $this->createdBy = $createdBy;
return $this; return $this;
} }
/** /**
* Get createdBy * Get createdBy
* *
* @return \KekRozsak\SecurityBundle\Entity\User * @return KekRozsak\SecurityBundle\Entity\User
*/ */
public function getCreatedBy() public function getCreatedBy()
{ {
@ -173,13 +177,14 @@ class News
/** /**
* Set public * Set public
* *
* @param boolean $public * @param boolean $public
* @return News * @return News
*/ */
public function setPublic($public) public function setPublic($public)
{ {
// TODO: Check if parameter is boolean! // TODO: Check if parameter is boolean!
$this->public = $public; $this->public = $public;
return $this; return $this;
} }

View File

@ -4,7 +4,7 @@ namespace KekRozsak\FrontBundle\Entity;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use \KekRozsak\SecurityBundle\Entity\User; use KekRozsak\SecurityBundle\Entity\User;
/** /**
* KekRozsak\FrontBundle\Entity\UserData * KekRozsak\FrontBundle\Entity\UserData
@ -38,12 +38,13 @@ class UserData
/** /**
* Set user * Set user
* *
* @param KekRozsak\SecurityBundle\Entity\User $user * @param KekRozsak\SecurityBundle\Entity\User $user
* @return UserData * @return UserData
*/ */
public function setUser(\KekRozsak\SecurityBundle\Entity\User $user) public function setUser(User $user)
{ {
$this->user = $user; $this->user = $user;
return $this; return $this;
} }
@ -69,13 +70,14 @@ class UserData
/** /**
* Set emailPublic * Set emailPublic
* *
* @param boolean $emailPublic * @param boolean $emailPublic
* @return UserData * @return UserData
*/ */
public function setEmailPublic($emailPublic) public function setEmailPublic($emailPublic)
{ {
// TODO: Check if parameter is boolean! // TODO: Check if parameter is boolean!
$this->emailPublic = $emailPublic; $this->emailPublic = $emailPublic;
return $this; return $this;
} }
@ -101,13 +103,14 @@ class UserData
/** /**
* Set realName * Set realName
* *
* @param string $realName * @param string $realName
* @return UserData * @return UserData
*/ */
public function setRealName($realName = null) public function setRealName($realName = null)
{ {
// TODO: Check if empty! // TODO: Check if empty!
$this->realName = $realName; $this->realName = $realName;
return $this; return $this;
} }
@ -133,13 +136,14 @@ class UserData
/** /**
* Set realNamePublic * Set realNamePublic
* *
* @param boolean $realNamePublic * @param boolean $realNamePublic
* @return UserData * @return UserData
*/ */
public function setRealNamePublic($realNamePublic = false) public function setRealNamePublic($realNamePublic = false)
{ {
// TODO: Check if parameter is boolean! // TODO: Check if parameter is boolean!
$this->realNamePublic = $realNamePublic; $this->realNamePublic = $realNamePublic;
return $this; return $this;
} }
@ -165,12 +169,13 @@ class UserData
/** /**
* Set selfDescription * Set selfDescription
* *
* @param string $selfDescription * @param string $selfDescription
* @return UserData * @return UserData
*/ */
public function setSelfDescription($selfDescription = null) public function setSelfDescription($selfDescription = null)
{ {
$this->selfDescription = $selfDescription; $this->selfDescription = $selfDescription;
return $this; return $this;
} }
@ -196,13 +201,14 @@ class UserData
/** /**
* Set msnAddress * Set msnAddress
* *
* @param string $msnAddress * @param string $msnAddress
* @return UserData * @return UserData
*/ */
public function setMsnAddress($msnAddress = null) public function setMsnAddress($msnAddress = null)
{ {
// TODO: Check if empty! // TODO: Check if empty!
$this->msnAddress = $msnAddress; $this->msnAddress = $msnAddress;
return $this; return $this;
} }
@ -228,13 +234,14 @@ class UserData
/** /**
* Set msnAddressPublic * Set msnAddressPublic
* *
* @param boolean $msnAddressPublic * @param boolean $msnAddressPublic
* @return UserData * @return UserData
*/ */
public function setMsnAddressPublic($msnAddressPublic) public function setMsnAddressPublic($msnAddressPublic)
{ {
// TODO: Check if parameter is boolean! // TODO: Check if parameter is boolean!
$this->msnAddressPublic = $msnAddressPublic; $this->msnAddressPublic = $msnAddressPublic;
return $this; return $this;
} }
@ -260,13 +267,14 @@ class UserData
/** /**
* Set googleTalk * Set googleTalk
* *
* @param string $googleTalk * @param string $googleTalk
* @return UserData * @return UserData
*/ */
public function setGoogleTalk($googleTalk = null) public function setGoogleTalk($googleTalk = null)
{ {
// TODO: Check if empty! // TODO: Check if empty!
$this->googleTalk = $googleTalk; $this->googleTalk = $googleTalk;
return $this; return $this;
} }
@ -292,13 +300,14 @@ class UserData
/** /**
* Set googleTalkPublic * Set googleTalkPublic
* *
* @param boolean $googleTalkPublic * @param boolean $googleTalkPublic
* @return UserData * @return UserData
*/ */
public function setGoogleTalkPublic($googleTalkPublic) public function setGoogleTalkPublic($googleTalkPublic)
{ {
// TODO: Check if parameter is boolean! // TODO: Check if parameter is boolean!
$this->googleTalkPublic = $googleTalkPublic; $this->googleTalkPublic = $googleTalkPublic;
return $this; return $this;
} }
@ -324,13 +333,14 @@ class UserData
/** /**
* Set skype * Set skype
* *
* @param string $skype * @param string $skype
* @return UserData * @return UserData
*/ */
public function setSkype($skype = null) public function setSkype($skype = null)
{ {
// TODO: Check if empty! // TODO: Check if empty!
$this->skype = $skype; $this->skype = $skype;
return $this; return $this;
} }
@ -356,13 +366,14 @@ class UserData
/** /**
* Set skypePublic * Set skypePublic
* *
* @param boolean $skypePublic * @param boolean $skypePublic
* @return UserData * @return UserData
*/ */
public function setSkypePublic($skypePublic) public function setSkypePublic($skypePublic)
{ {
// TODO: Check if parameter is boolean! // TODO: Check if parameter is boolean!
$this->skypePublic = $skypePublic; $this->skypePublic = $skypePublic;
return $this; return $this;
} }
@ -388,13 +399,14 @@ class UserData
/** /**
* Set phoneNumber * Set phoneNumber
* *
* @param string $phoneNumber * @param string $phoneNumber
* @return UserData * @return UserData
*/ */
public function setPhoneNumber($phoneNumber = null) public function setPhoneNumber($phoneNumber = null)
{ {
// TODO: Check if empty! // TODO: Check if empty!
$this->phoneNumber = $phoneNumber; $this->phoneNumber = $phoneNumber;
return $this; return $this;
} }
@ -420,13 +432,14 @@ class UserData
/** /**
* Set phoneNumberPublic * Set phoneNumberPublic
* *
* @param boolean $phoneNumberPublic * @param boolean $phoneNumberPublic
* @return UserData * @return UserData
*/ */
public function setPhoneNumberPublic($phoneNumberPublic) public function setPhoneNumberPublic($phoneNumberPublic)
{ {
// TODO: Check if parameter is boolean! // TODO: Check if parameter is boolean!
$this->phoneNumberPublic = $phoneNumberPublic; $this->phoneNumberPublic = $phoneNumberPublic;
return $this; return $this;
} }

View File

@ -16,7 +16,7 @@ use KekRozsak\FrontBundle\Entity\Group;
*/ */
class UserGroupMembership class UserGroupMembership
{ {
public function __construct(\KekRozsak\SecurityBundle\Entity\User $user, \KekRozsak\FrontBundle\Entity\Group $group) public function __construct(User $user, Group $group)
{ {
$this->setUser($user); $this->setUser($user);
$this->setGroup($group); $this->setGroup($group);
@ -57,13 +57,14 @@ class UserGroupMembership
/** /**
* Set user * Set user
* *
* @param KekRozsak\SecurityBundle\Entity\User $user * @param KekRozsak\SecurityBundle\Entity\User $user
* @return UserGroupMembership * @return UserGroupMembership
*/ */
public function setUser(User $user) public function setUser(User $user)
{ {
// TODO: Check if not null! // TODO: Check if not null!
$this->user = $user; $this->user = $user;
return $this; return $this;
} }
@ -96,6 +97,7 @@ class UserGroupMembership
public function setGroup(Group $group) public function setGroup(Group $group)
{ {
$this->group = $group; $this->group = $group;
return $this; return $this;
} }
@ -121,13 +123,14 @@ class UserGroupMembership
/** /**
* Set membershipRequestedAt * Set membershipRequestedAt
* *
* @param DateTime $membershipRequestedAt * @param DateTime $membershipRequestedAt
* @return UserGroupMembership * @return UserGroupMembership
*/ */
public function setMembershipRequestedAt(\DateTime $membershipRequestedAt) public function setMembershipRequestedAt(\DateTime $membershipRequestedAt)
{ {
// TODO: Check if null! // TODO: Check if null!
$this->membershipRequestedAt = $membershipRequestedAt; $this->membershipRequestedAt = $membershipRequestedAt;
return $this; return $this;
} }
@ -153,12 +156,13 @@ class UserGroupMembership
/** /**
* Set membershipAcceptedAt * Set membershipAcceptedAt
* *
* @param DateTime $membershipAcceptedAt * @param DateTime $membershipAcceptedAt
* @return UserGroupMembership * @return UserGroupMembership
*/ */
public function setMembershipAcceptedAt(\DateTime $membershipAcceptedAt = null) public function setMembershipAcceptedAt(\DateTime $membershipAcceptedAt = null)
{ {
$this->membershipAcceptedAt = $membershipAcceptedAt; $this->membershipAcceptedAt = $membershipAcceptedAt;
return $this; return $this;
} }
@ -188,9 +192,10 @@ class UserGroupMembership
* @param KekRozsak\SecurityBundle\Entity\User * @param KekRozsak\SecurityBundle\Entity\User
* @return UserGroupMembership * @return UserGroupMembership
*/ */
public function setMembershipAcceptedBy(\KekRozsak\SecurityBundle\Entity\User $membershipAcceptedBy = null) public function setMembershipAcceptedBy(User $membershipAcceptedBy = null)
{ {
$this->membershipAcceptedBy = $membershipAcceptedBy; $this->membershipAcceptedBy = $membershipAcceptedBy;
return $this; return $this;
} }

View File

@ -7,7 +7,7 @@ class Slugifier
/** /**
* Slugify string * Slugify string
* *
* @param string $text * @param string $text
* @return string * @return string
*/ */
public function slugify($text) public function slugify($text)

View File

@ -13,13 +13,13 @@ class GroupType extends AbstractType
'label' => 'A csoport neve', 'label' => 'A csoport neve',
) )
); );
$builder->add('description', 'ckeditor', array( $builder->add('description', 'ckeditor', array(
'label' => 'A csoport leírása', 'label' => 'A csoport leírása',
) )
); );
} }
public function getName() public function getName()
{ {
return 'group'; return 'group';

View File

@ -138,4 +138,3 @@
{% block bottomscripts %}{% endblock %} {% block bottomscripts %}{% endblock %}
</body> </body>
</html> </html>

View File

@ -7,4 +7,4 @@
{% endif %} {% endif %}
<p class="hir-datum">{{ news.createdAt|date('Y-m-d H:i') }}</p> <p class="hir-datum">{{ news.createdAt|date('Y-m-d H:i') }}</p>
</div> </div>
{% endfor %} {% endfor %}

View File

@ -21,7 +21,7 @@ class EventsExtension extends \Twig_Extension
* "securityContext" = @DI\Inject("security.context") * "securityContext" = @DI\Inject("security.context")
* }) * })
* *
* @param \Symfony\Bridge\Doctrine\RegistryInterface $doctrine * @param \Symfony\Bridge\Doctrine\RegistryInterface $doctrine
* @param \Symfony\Component\Security\Core\SecurityContextInterface $securityContext * @param \Symfony\Component\Security\Core\SecurityContextInterface $securityContext
*/ */
public function __construct(RegistryInterface $doctrine, SecurityContextInterface $securityContext) public function __construct(RegistryInterface $doctrine, SecurityContextInterface $securityContext)
@ -56,7 +56,7 @@ class EventsExtension extends \Twig_Extension
); );
$eventList[$i]['date'] = $date; $eventList[$i]['date'] = $date;
$eventList[$i]['events'] = array(); $eventList[$i]['events'] = array();
foreach ($events as $event) { foreach ($events as $event) {
if ($event->isOnDate($date)) { if ($event->isOnDate($date)) {
$eventList[$i]['events'][] = $event; $eventList[$i]['events'][] = $event;
} }

View File

@ -7,7 +7,7 @@ use JMS\DiExtraBundle\Annotation as DI;
/** /**
* @DI\Service * @DI\Service
* @DI\Tag("twig.extension") * @DI\Tag("twig.extension")
* *
*/ */
class TwigBBExtension extends \Twig_Extension class TwigBBExtension extends \Twig_Extension
{ {

View File

@ -23,7 +23,6 @@ class Configuration implements ConfigurationInterface
// Here you should define the parameters that are allowed to // Here you should define the parameters that are allowed to
// configure your bundle. See the documentation linked above for // configure your bundle. See the documentation linked above for
// more information on that topic. // more information on that topic.
return $treeBuilder; return $treeBuilder;
} }
} }

View File

@ -5,8 +5,6 @@ namespace KekRozsak\SecurityBundle\Entity;
use Doctrine\ORM\Mapping as ORM; use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Security\Core\Role\RoleInterface; use Symfony\Component\Security\Core\Role\RoleInterface;
use KekRozsak\SecurityBundle\Entity\User;
/** /**
* KekRozsak\SecurityBundle\Entity\Role * KekRozsak\SecurityBundle\Entity\Role
* *
@ -48,13 +46,14 @@ class Role implements RoleInterface
/** /**
* Set name * Set name
* *
* @param string $name * @param string $name
* @return Role * @return Role
*/ */
public function setName($name) public function setName($name)
{ {
// TODO: Check if null or empty! // TODO: Check if null or empty!
$this->name = $name; $this->name = $name;
return $this; return $this;
} }
@ -86,6 +85,7 @@ class Role implements RoleInterface
{ {
// TODO: Check if parameter is boolean! // TODO: Check if parameter is boolean!
$this->default = $default; $this->default = $default;
return $this; return $this;
} }
@ -101,12 +101,13 @@ class Role implements RoleInterface
/** /**
* Set description * Set description
* *
* @param string $description * @param string $description
* @return Role * @return Role
*/ */
public function setDescription($description = null) public function setDescription($description = null)
{ {
$this->description = $description; $this->description = $description;
return $this; return $this;
} }
@ -139,13 +140,14 @@ class Role implements RoleInterface
/** /**
* Set shortDescription * Set shortDescription
* *
* @param string $shortDescription * @param string $shortDescription
* @return Role * @return Role
*/ */
public function setShortDescription($shortDescription) public function setShortDescription($shortDescription)
{ {
// TODO: Check if empty or null! // TODO: Check if empty or null!
$this->shortDescription = $shortDescription; $this->shortDescription = $shortDescription;
return $this; return $this;
} }

View File

@ -63,13 +63,14 @@ class User implements UserInterface, AdvancedUserInterface
/** /**
* Set username * Set username
* *
* @param string $username * @param string $username
* @return User * @return User
*/ */
public function setUsername($username) public function setUsername($username)
{ {
// TODO: check if null or empty! // TODO: check if null or empty!
$this->username = $username; $this->username = $username;
return $this; return $this;
} }
@ -96,12 +97,13 @@ class User implements UserInterface, AdvancedUserInterface
/** /**
* Set password * Set password
* *
* @param string $password * @param string $password
* @return User * @return User
*/ */
public function setPassword($password) public function setPassword($password)
{ {
$this->password = $password; $this->password = $password;
return $this; return $this;
} }
@ -127,13 +129,14 @@ class User implements UserInterface, AdvancedUserInterface
/** /**
* Set displayName * Set displayName
* *
* @param string $displayName * @param string $displayName
* @return User * @return User
*/ */
public function setDisplayName($displayName) public function setDisplayName($displayName)
{ {
// TODO: Check if empty or null! // TODO: Check if empty or null!
$this->displayName = $displayName; $this->displayName = $displayName;
return $this; return $this;
} }
@ -159,13 +162,14 @@ class User implements UserInterface, AdvancedUserInterface
/** /**
* Set email * Set email
* *
* @param string $email * @param string $email
* @return User * @return User
*/ */
public function setEmail($email) public function setEmail($email)
{ {
// TODO: Check if empty or null! // TODO: Check if empty or null!
$this->email = $email; $this->email = $email;
return $this; return $this;
} }
@ -191,12 +195,13 @@ class User implements UserInterface, AdvancedUserInterface
/** /**
* Set registeredAt * Set registeredAt
* *
* @param DateTime $registeredAt * @param DateTime $registeredAt
* @return User * @return User
*/ */
public function setRegisteredAt(\DateTime $registeredAt) public function setRegisteredAt(\DateTime $registeredAt)
{ {
$this->registeredAt = $registeredAt; $this->registeredAt = $registeredAt;
return $this; return $this;
} }
@ -223,12 +228,13 @@ class User implements UserInterface, AdvancedUserInterface
/** /**
* Set acceptedBy * Set acceptedBy
* *
* @param User $acceptedBy * @param User $acceptedBy
* @return User * @return User
*/ */
public function setAcceptedBy(User $acceptedBy = null) public function setAcceptedBy(User $acceptedBy = null)
{ {
$this->acceptedBy = $acceptedBy; $this->acceptedBy = $acceptedBy;
return $this; return $this;
} }
@ -254,12 +260,13 @@ class User implements UserInterface, AdvancedUserInterface
/** /**
* Set lastLoginAt; * Set lastLoginAt;
* *
* @param DateTime $lastLoginAt * @param DateTime $lastLoginAt
* @return User * @return User
*/ */
public function setLastLoginAt(\DateTime $lastLoginAt = null) public function setLastLoginAt(\DateTime $lastLoginAt = null)
{ {
$this->lastLoginAt = $lastLoginAt; $this->lastLoginAt = $lastLoginAt;
return $this; return $this;
} }
@ -276,7 +283,7 @@ class User implements UserInterface, AdvancedUserInterface
/** /**
* The UserData object for this User * The UserData object for this User
* *
* @var \KekRozsak\FrontBundle\Entity\UserData $userData * @var KekRozsak\FrontBundle\Entity\UserData $userData
* *
* @ORM\OneToOne(targetEntity="KekRozsak\FrontBundle\Entity\UserData", fetch="LAZY", cascade={"persist"}, mappedBy="user") * @ORM\OneToOne(targetEntity="KekRozsak\FrontBundle\Entity\UserData", fetch="LAZY", cascade={"persist"}, mappedBy="user")
*/ */
@ -285,20 +292,21 @@ class User implements UserInterface, AdvancedUserInterface
/** /**
* Set userData * Set userData
* *
* @param \KekRozsak\FrontBundle\Entity\UserData $userData * @param KekRozsak\FrontBundle\Entity\UserData $userData
* @return User * @return User
*/ */
public function setUserData(\KekRozsak\FrontBundle\Entity\UserData $userData = null) public function setUserData(UserData $userData = null)
{ {
$this->userData = $userData; $this->userData = $userData;
$userData->setUser($this); $userData->setUser($this);
return $this; return $this;
} }
/** /**
* Get userData * Get userData
* *
* @return \KekRozsak\FrontBundle\Entity\UserData * @return KekRozsak\FrontBundle\Entity\UserData
*/ */
public function getUserData() public function getUserData()
{ {
@ -319,13 +327,14 @@ class User implements UserInterface, AdvancedUserInterface
/** /**
* Add group * Add group
* *
* @param KekRozsak\FrontBundle\Entity\UserGroupMembership $group * @param KekRozsak\FrontBundle\Entity\UserGroupMembership $group
* @return User * @return User
*/ */
public function addGroup(UserGroupMembership $group) public function addGroup(UserGroupMembership $group)
{ {
// TODO: Check if null! // TODO: Check if null!
$this->groups[] = $group; $this->groups[] = $group;
return $this; return $this;
} }
@ -351,13 +360,14 @@ class User implements UserInterface, AdvancedUserInterface
/** /**
* Add a role * Add a role
* *
* @param KekRozsak\SecurityBundle\Entity\Role $role * @param KekRozsak\SecurityBundle\Entity\Role $role
* @return User * @return User
*/ */
public function addRole(Role $role) public function addRole(Role $role)
{ {
// TODO: Check if null! // TODO: Check if null!
$this->roles[] = $role; $this->roles[] = $role;
return $this; return $this;
} }
@ -390,6 +400,7 @@ class User implements UserInterface, AdvancedUserInterface
* As we use crypt() to encode passwords, salt is always the same as the * As we use crypt() to encode passwords, salt is always the same as the
* password * password
*/ */
return $this->password; return $this->password;
} }
@ -402,24 +413,28 @@ class User implements UserInterface, AdvancedUserInterface
public function isAccountNonExpired() public function isAccountNonExpired()
{ {
/* Currently, accounts never expire */ /* Currently, accounts never expire */
return true; return true;
} }
public function isAccountNonLocked() public function isAccountNonLocked()
{ {
/* Currently, accounts cannot be locked */ /* Currently, accounts cannot be locked */
return true; return true;
} }
public function isCredentialsNonExpired() public function isCredentialsNonExpired()
{ {
/* Currently, credentials never expire */ /* Currently, credentials never expire */
return true; return true;
} }
public function isEnabled() public function isEnabled()
{ {
/* Account is enabled if it is accepted by someone */ /* Account is enabled if it is accepted by someone */
return ($this->acceptedBy !== null); return ($this->acceptedBy !== null);
} }
} }

View File

@ -9,12 +9,12 @@ use JMS\DiExtraBundle\Annotation as DI;
*/ */
class CryptEncoder implements PasswordEncoderInterface class CryptEncoder implements PasswordEncoderInterface
{ {
function encodePassword($raw, $salt) public function encodePassword($raw, $salt)
{ {
return crypt($raw); return crypt($raw);
} }
function isPasswordValid($encoded, $raw, $salt) public function isPasswordValid($encoded, $raw, $salt)
{ {
return (crypt($raw, $salt) == $encoded); return (crypt($raw, $salt) == $encoded);
} }

View File

@ -10,15 +10,15 @@ class RoleHierarchy implements RoleHierarchyInterface
private $hierarchy; private $hierarchy;
private $roleRepo; private $roleRepo;
private $map; private $map;
public function __construct(RegistryInterface $doctrine) public function __construct(RegistryInterface $doctrine)
{ {
$this->hierarchy = array(); $this->hierarchy = array();
$this->roleRepo = $doctrine->getRepository('KekRozsakSecurityBundle:Role'); $this->roleRepo = $doctrine->getRepository('KekRozsakSecurityBundle:Role');
$this->buildRoleMap(); $this->buildRoleMap();
} }
public function getReachableRoles(array $roles) public function getReachableRoles(array $roles)
{ {
$reachableRoles = array(); $reachableRoles = array();
@ -26,17 +26,17 @@ class RoleHierarchy implements RoleHierarchyInterface
if (!isset($this->map[$role->getRole()])) { if (!isset($this->map[$role->getRole()])) {
continue; continue;
} }
foreach ($this->map[$role->getRole()] as $r) { foreach ($this->map[$role->getRole()] as $r) {
if (($childRole = $this->roleRepo->findOneByName($r)) !== null) { if (($childRole = $this->roleRepo->findOneByName($r)) !== null) {
$reachableRoles[] = $childRole; $reachableRoles[] = $childRole;
} }
} }
} }
return $reachableRoles; return $reachableRoles;
} }
private function buildRoleMap() private function buildRoleMap()
{ {
$this->map = array(); $this->map = array();

View File

@ -23,7 +23,7 @@ class UserDataSpanExtension extends \Twig_Extension
* "security" = @DI\Inject("security.context") * "security" = @DI\Inject("security.context")
* }) * })
* *
* @param \Symfony\Bundle\FrameworkBundle\Routing\Router $router * @param \Symfony\Bundle\FrameworkBundle\Routing\Router $router
* @param \Symfony\Component\Security\Core\SecurityContextInterface $security * @param \Symfony\Component\Security\Core\SecurityContextInterface $security
*/ */
public function __construct(Router $router, SecurityContextInterface $security) public function __construct(Router $router, SecurityContextInterface $security)

View File

@ -1,5 +1,5 @@
<?php <?php
$dev_ips = array( $dev_ips = array(
'127.0.0.1', '127.0.0.1',
'::1', '::1',
); );