-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
494 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
newscoop/install/Resources/sql/upgrade/4.4.x/2015.07.06/data-required.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
INSERT INTO output_publication (fk_output_id, fk_publication_id, fk_language_id, fk_theme_path_id) SELECT DISTINCT 1, IdPublication, IdLanguage, NULL FROM Issues; |
9 changes: 9 additions & 0 deletions
9
newscoop/install/Resources/sql/upgrade/4.4.x/2015.07.06/tables.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
CREATE TABLE IF NOT EXISTS `output_publication` ( | ||
`id` int(11) unsigned NOT NULL AUTO_INCREMENT, | ||
`fk_output_id` int(11) unsigned NOT NULL, | ||
`fk_publication_id` int(11) unsigned NOT NULL, | ||
`fk_language_id` int(11) unsigned NOT NULL, | ||
`fk_theme_path_id` int(11) unsigned DEFAULT NULL, | ||
PRIMARY KEY (`id`), | ||
UNIQUE KEY `publication_language` (`fk_publication_id`,`fk_language_id`) | ||
) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
154 changes: 154 additions & 0 deletions
154
newscoop/library/Newscoop/Entity/Output/OutputSettingsPublication.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
<?php | ||
/** | ||
* @package Newscoop | ||
* @author Mischa Gorinskat <mischa.gorinskat@sourcefabric.org> | ||
* @copyright 2015 Sourcefabric o.p.s. | ||
* @license http://www.gnu.org/licenses/gpl-3.0.txt | ||
*/ | ||
|
||
namespace Newscoop\Entity\Output; | ||
|
||
use Doctrine\ORM\Mapping AS ORM; | ||
use Newscoop\Entity\AbstractEntity; | ||
|
||
/** | ||
* Provides the settings for the output for a publication. | ||
* | ||
* @ORM\Entity | ||
* @ORM\Table(name="output_publication", uniqueConstraints={@ORM\UniqueConstraint(name="publication_language", columns={"fk_publication_id", "fk_langyage_id"})}) | ||
*/ | ||
class OutputSettingsPublication extends AbstractEntity | ||
{ | ||
/** | ||
* Provides the class name as a constant. | ||
*/ | ||
const NAME_1 = __CLASS__; | ||
|
||
/** | ||
* @ORM\ManyToOne(targetEntity="Newscoop\Entity\Output") | ||
* @ORM\JoinColumn(name="fk_output_id", referencedColumnName="id", nullable=FALSE) | ||
* @var Newscoop\Entity\Output | ||
*/ | ||
protected $output; | ||
|
||
/** | ||
* @ORM\ManyToOne(targetEntity="Newscoop\Entity\Publication", inversedBy="outputSettingsPublication") | ||
* @ORM\JoinColumn(name="fk_publication_id", referencedColumnName="Id") | ||
* @var Newscoop\Entity\Publication | ||
*/ | ||
protected $publication; | ||
|
||
/** | ||
* @ORM\ManyToOne(targetEntity="Newscoop\Entity\Language") | ||
* @ORM\JoinColumn(name="fk_language_id", referencedColumnName="Id") | ||
* @var Newscoop\Entity\Language | ||
*/ | ||
protected $language; | ||
|
||
|
||
/** | ||
* @ORM\ManyToOne(targetEntity="Newscoop\Entity\Resource") | ||
* @ORM\JoinColumn(name="fk_theme_path_id", referencedColumnName="id") | ||
* @var Newscoop\Entity\Resource | ||
*/ | ||
protected $themePath; | ||
|
||
/** | ||
* Getter for output | ||
* | ||
* @return mixed | ||
*/ | ||
public function getOutput() | ||
{ | ||
return $this->output; | ||
} | ||
|
||
/** | ||
* Setter for output | ||
* | ||
* @param mixed $output Value to set | ||
* | ||
* @return self | ||
*/ | ||
public function setOutput($output) | ||
{ | ||
$this->output = $output; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* Getter for publication | ||
* | ||
* @return \Newscoop\Entity\Publication | ||
*/ | ||
public function getPublication() | ||
{ | ||
return $this->publication; | ||
} | ||
|
||
/** | ||
* Setter for publication | ||
* | ||
* @param \Newscoop\Entity\Publication $publication Value to set | ||
* | ||
* @return self | ||
*/ | ||
public function setPublication($publication) | ||
{ | ||
$this->publication = $publication; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* Getter for language | ||
* | ||
* @return \Newscoop\Entity\Language | ||
*/ | ||
public function getLanguage() | ||
{ | ||
return $this->language; | ||
} | ||
|
||
/** | ||
* Setter for language | ||
* | ||
* @param \Newscoop\Entity\Language $language Value to set | ||
* | ||
* @return self | ||
*/ | ||
public function setLanguage($language) | ||
{ | ||
$this->language = $language; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* Provides the path of the theme associated. | ||
* | ||
* @return Newscoop\Entity\Resource|null | ||
* The path of the theme. | ||
*/ | ||
public function getThemePath() | ||
{ | ||
return $this->themePath; | ||
} | ||
|
||
/** | ||
* Set the path of the theme associated. | ||
* | ||
* @param Newscoop\Entity\Resource|null $themePath | ||
* The path of the theme, can be empty. | ||
* | ||
* @return Newscoop\Entity\PublicationTheme | ||
* This object for chaining purposes. | ||
*/ | ||
public function setThemePath($themePath) | ||
{ | ||
$this->themePath = $themePath; | ||
|
||
return $this; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.