Use TimestampableEntity trait + format code

pull/3016/head
Julio Montoya 6 years ago
parent dfa41d5995
commit de9018ea2b
  1. 28
      main/install/index.php
  2. 2
      src/ClassificationBundle/ChamiloClassificationBundle.php
  3. 65
      src/FaqBundle/Entity/Category.php
  4. 1
      src/FaqBundle/Entity/CategoryTranslation.php
  5. 66
      src/FaqBundle/Entity/Question.php
  6. 2
      src/FaqBundle/Entity/QuestionTranslation.php
  7. 21
      src/SkillBundle/Entity/SkillRelCourse.php
  8. 20
      src/SkillBundle/Entity/SkillRelItem.php
  9. 22
      src/SkillBundle/Entity/SkillRelItemRelUser.php

@ -60,7 +60,6 @@ session_start();
require_once 'install.lib.php';
$installationLanguage = 'en';
// Determination of the language during the installation procedure.
if (!empty($_POST['language_list'])) {
@ -120,25 +119,6 @@ $session_lifetime = 360000;
//$installLanguage = isset($_SESSION['install_language']) ? $_SESSION['install_language'] : 'english';
$installLanguage = '';
$installationGuideLink = '../../documentation/installation_guide.html';
/*
// Loading language files.
require api_get_path(SYS_LANG_PATH).'english/trad4all.inc.php';
if ($installationLanguage != 'english') {
include_once api_get_path(SYS_LANG_PATH).$installationLanguage.'/trad4all.inc.php';
switch ($installationLanguage) {
case 'french':
$installationGuideLink = '../../documentation/installation_guide_fr_FR.html';
break;
case 'spanish':
$installationGuideLink = '../../documentation/installation_guide_es_ES.html';
break;
case 'italian':
$installationGuideLink = '../../documentation/installation_guide_it_IT.html';
break;
default:
break;
}
}*/
// Enables the portability layer and configures PHP for UTF-8
\Patchwork\Utf8\Bootup::initAll();
@ -146,9 +126,6 @@ if ($installationLanguage != 'english') {
// Setting the error reporting levels.
error_reporting(E_ALL);
// Overriding the timelimit (for large campusses that have to be migrated).
//@set_time_limit(0);
// Upgrading from any subversion of 1.9
$update_from_version_8 = [
'1.9.0',
@ -529,7 +506,6 @@ if (isset($_POST['step2'])) {
false
);
} ?>
<table width="100%">
<tr>
<td>
@ -609,10 +585,6 @@ if (isset($_POST['step2'])) {
$kernel = new Kernel('dev', true);
$application = new Application($kernel);
error_log('Set Kernel');
// Create database
/*$input = new ArrayInput([]);
$command = $application->find('doctrine:schema:create');
$result = $command->run($input, new ConsoleOutput());*/
session_unset();
$_SESSION = [];

@ -7,8 +7,6 @@ use Symfony\Component\HttpKernel\Bundle\Bundle;
/**
* Class ChamiloClassificationBundle.
*
* @package Chamilo\ClassificationBundle
*/
class ChamiloClassificationBundle extends Bundle
{

@ -6,6 +6,7 @@ namespace Chamilo\FaqBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Knp\DoctrineBehaviors\Model as ORMBehaviors;
use Gedmo\Timestampable\Traits\TimestampableEntity;
/**
* Class Category.
@ -15,12 +16,11 @@ use Knp\DoctrineBehaviors\Model as ORMBehaviors;
* name="faq_category",
* indexes={@ORM\Index(name="is_active_idx", columns={"is_active"})}
* )
*
* @package Chamilo\FaqBundle\Entity
*/
class Category
{
use ORMBehaviors\Translatable\Translatable;
use TimestampableEntity;
/**
* @ORM\Column(type="integer")
@ -46,19 +46,6 @@ class Category
*/
protected $isActive;
/**
* @Gedmo\Timestampable(on="create")
*
* @ORM\Column(name="created_at", type="datetime")
*/
protected $createdAt;
/**
* @Gedmo\Timestampable(on="update")
* @ORM\Column(name="updated_at", type="datetime")
*/
protected $updatedAt;
/**
* @param $method
* @param $arguments
@ -138,54 +125,6 @@ class Category
return $this->isActive;
}
/**
* Set createdAt.
*
* @param \DateTime $createdAt
*
* @return Category
*/
public function setCreatedAt(\DateTime $createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
/**
* Get createdAt.
*
* @return \DateTime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* Set updatedAt.
*
* @param \DateTime $updatedAt
*
* @return Category
*/
public function setUpdatedAt(\DateTime $updatedAt)
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* Get updatedAt.
*
* @return \DateTime
*/
public function getUpdatedAt()
{
return $this->updatedAt;
}
/**
* Add question.
*

@ -25,7 +25,6 @@ use Knp\DoctrineBehaviors\Model as ORMBehaviors;
* )
* })
*
* @package Chamilo\FaqBundle\Entity
*/
class CategoryTranslation
{

@ -5,6 +5,7 @@ namespace Chamilo\FaqBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Gedmo\Timestampable\Traits\TimestampableEntity;
use Knp\DoctrineBehaviors\Model as ORMBehaviors;
/**
@ -12,13 +13,12 @@ use Knp\DoctrineBehaviors\Model as ORMBehaviors;
*
* @ORM\Entity(repositoryClass="Chamilo\FaqBundle\Repository\QuestionRepository")
* @ORM\Table(name="faq_question")
* *
*
* @package Chamilo\FaqBundle\Entity
*/
class Question
{
use ORMBehaviors\Translatable\Translatable;
use TimestampableEntity;
/**
* @ORM\Column(type="integer")
@ -40,21 +40,9 @@ class Question
*/
protected $rank;
/**
* @Gedmo\Timestampable(on="create")
*
* @ORM\Column(name="created_at", type="datetime")
*/
protected $createdAt;
/**
* @Gedmo\Timestampable(on="update")
* @ORM\Column(name="updated_at", type="datetime")
*/
protected $updatedAt;
/**
* @var bool
*
* @ORM\Column(name="only_auth_users", type="boolean", nullable=false)
*/
protected $onlyAuthUsers;
@ -119,54 +107,6 @@ class Question
return $this;
}
/**
* Set createdAt.
*
* @param \DateTime $createdAt
*
* @return Question
*/
public function setCreatedAt($createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
/**
* Get createdAt.
*
* @return \DateTime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* Set updatedAt.
*
* @param \DateTime $updatedAt
*
* @return Question
*/
public function setUpdatedAt($updatedAt)
{
$this->updatedAt = $updatedAt;
return $this;
}
/**
* Get updatedAt.
*
* @return \DateTime
*/
public function getUpdatedAt()
{
return $this->updatedAt;
}
/**
* Set category.
*

@ -25,8 +25,6 @@ use Knp\DoctrineBehaviors\Model as ORMBehaviors;
* )
* )
* })
*
* @package Chamilo\FaqBundle\Entity
*/
class QuestionTranslation
{

@ -8,6 +8,7 @@ use Chamilo\CoreBundle\Entity\Session;
use Chamilo\CoreBundle\Entity\Skill;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Gedmo\Timestampable\Traits\TimestampableEntity;
/**
* SkillRelCourse.
@ -17,6 +18,8 @@ use Gedmo\Mapping\Annotation as Gedmo;
*/
class SkillRelCourse
{
use TimestampableEntity;
/**
* @var int
*
@ -50,24 +53,6 @@ class SkillRelCourse
*/
protected $session;
/**
* @var \DateTime
*
* @Gedmo\Timestampable(on="create")
*
* @ORM\Column(name="created_at", type="datetime")
*/
protected $createdAt;
/**
* @var \DateTime
*
* @Gedmo\Timestampable(on="update")
*
* @ORM\Column(name="updated_at", type="datetime")
*/
protected $updatedAt;
/**
* SkillRelItem constructor.
*/

@ -5,7 +5,7 @@ namespace Chamilo\SkillBundle\Entity;
use Chamilo\CoreBundle\Entity\Skill;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Gedmo\Timestampable\Traits\TimestampableEntity;
/**
* SkillRelItem.
@ -15,6 +15,8 @@ use Gedmo\Mapping\Annotation as Gedmo;
*/
class SkillRelItem
{
use TimestampableEntity;
/**
* @var int
*
@ -91,22 +93,6 @@ class SkillRelItem
*/
protected $sessionId;
/**
* @var \DateTime
*
* @Gedmo\Timestampable(on="create")
* @ORM\Column(name="created_at", type="datetime")
*/
protected $createdAt;
/**
* @var \DateTime
*
* @Gedmo\Timestampable(on="update")
* @ORM\Column(name="updated_at", type="datetime")
*/
protected $updatedAt;
/**
* @var int
*

@ -5,7 +5,7 @@ namespace Chamilo\SkillBundle\Entity;
use Chamilo\UserBundle\Entity\User;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Gedmo\Timestampable\Traits\TimestampableEntity;
/**
* SkillRelItemRelUser.
@ -15,6 +15,8 @@ use Gedmo\Mapping\Annotation as Gedmo;
*/
class SkillRelItemRelUser
{
use TimestampableEntity;
/**
* @var int
*
@ -26,6 +28,7 @@ class SkillRelItemRelUser
/**
* @var SkillRelItem
*
* @ORM\ManyToOne(targetEntity="Chamilo\SkillBundle\Entity\SkillRelItem", cascade={"persist"})
* @ORM\JoinColumn(name="skill_rel_item_id", referencedColumnName="id", nullable=false)
*/
@ -33,6 +36,7 @@ class SkillRelItemRelUser
/**
* @var User
*
* @ORM\ManyToOne(targetEntity="Chamilo\UserBundle\Entity\User", cascade={"persist"})
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
*/
@ -45,22 +49,6 @@ class SkillRelItemRelUser
*/
protected $resultId;
/**
* @var \DateTime
*
* @Gedmo\Timestampable(on="create")
* @ORM\Column(name="created_at", type="datetime")
*/
protected $createdAt;
/**
* @var \DateTime
*
* @Gedmo\Timestampable(on="update")
* @ORM\Column(name="updated_at", type="datetime")
*/
protected $updatedAt;
/**
* @var int
*

Loading…
Cancel
Save