Skip to content

Commit

Permalink
Add branch tables see BT#7721
Browse files Browse the repository at this point in the history
  • Loading branch information
jmontoyaa committed Jun 3, 2015
1 parent 56986df commit cb3f1a4
Show file tree
Hide file tree
Showing 9 changed files with 1,612 additions and 1 deletion.
743 changes: 743 additions & 0 deletions src/Chamilo/CoreBundle/Entity/BranchSync.php

Large diffs are not rendered by default.

418 changes: 418 additions & 0 deletions src/Chamilo/CoreBundle/Entity/BranchTransaction.php

Large diffs are not rendered by default.

64 changes: 64 additions & 0 deletions src/Chamilo/CoreBundle/Entity/BranchTransactionStatus.php
@@ -0,0 +1,64 @@
<?php
/* For licensing terms, see /license.txt */

namespace Chamilo\CoreBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
* BranchTransactionStatus
*
* @ORM\Table(name="branch_transaction_status")
* @ORM\Entity
*/
class BranchTransactionStatus
{
/**
* @var integer
*
* @ORM\Column(name="id", type="integer", nullable=false, unique=false)
* @ORM\Id
* @ORM\GeneratedValue
*/
private $id;

/**
* @var string
*
* @ORM\Column(name="title", type="string", length=255, nullable=true, unique=false)
*/
private $title;

/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}

/**
* Set title
*
* @param string $title
* @return BranchTransactionStatus
*/
public function setTitle($title)
{
$this->title = $title;

return $this;
}

/**
* Get title
*
* @return string
*/
public function getTitle()
{
return $this->title;
}
}
29 changes: 28 additions & 1 deletion src/Chamilo/CoreBundle/Entity/Course.php
Expand Up @@ -264,13 +264,21 @@ class Course
**/
//protected $curriculumCategories;

/**
* @var Room
*
* @ORM\ManyToOne(targetEntity="Room")
* @ORM\JoinColumn(name="room_id", referencedColumnName="id")
**/
private $room;

/**
* @var Session
**/
protected $currentSession;

/**
*
* Constructor
*/
public function __construct()
{
Expand Down Expand Up @@ -1111,6 +1119,25 @@ public function getCourseTypeId()
return $this->courseTypeId;
}

/**
* @return Room
*/
public function getRoom()
{
return $this->room;
}

/**
* @param Room $room
* @return Course
*/
public function setRoom($room)
{
$this->room = $room;

return $this;
}

/**
* @return string
*/
Expand Down
37 changes: 37 additions & 0 deletions src/Chamilo/CoreBundle/Entity/Repository/BranchSyncRepository.php
@@ -0,0 +1,37 @@
<?php
/* For licensing terms, see /license.txt */

namespace Chamilo\CoreBundle\Entity\Repository;

use Gedmo\Tree\Entity\Repository\NestedTreeRepository;

/**
* Class BranchSyncRepository
* @package Chamilo\CoreBundle\Entity\Repository
*/
class BranchSyncRepository extends NestedTreeRepository
{
/**
* @param string $keyword
* @return mixed
*/
public function searchByKeyword($keyword)
{
$qb = $this->createQueryBuilder('a');

//Selecting user info
$qb->select('DISTINCT b');

$qb->from('Chamilo\CoreBundle\Entity\BranchSync', 'b');

//Selecting courses for users
//$qb->innerJoin('u.courses', 'c');

//@todo check app settings
$qb->add('orderBy', 'b.branchName ASC');
$qb->where('b.branchName LIKE :keyword');
$qb->setParameter('keyword', "%$keyword%");
$q = $qb->getQuery();
return $q->execute();
}
}
199 changes: 199 additions & 0 deletions src/Chamilo/CoreBundle/Entity/Room.php
@@ -0,0 +1,199 @@
<?php
/* For licensing terms, see /license.txt */

namespace Chamilo\CoreBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
* Room
*
* @ORM\Table(name="room")
* @ORM\Entity
*/
class Room
{
/**
* @var integer
*
* @ORM\Column(name="id", type="integer", nullable=false, unique=false)
* @ORM\Id
* @ORM\GeneratedValue
*/
private $id;

/**
* @var string
*
* @ORM\Column(name="title", type="string", length=255, nullable=true, unique=false)
*/
private $title;

/**
* @var string
*
* @ORM\Column(name="description", type="text", nullable=true)
*/
private $description;

/**
* @var string
*
* @ORM\Column(name="geolocation", type="string", length=255, nullable=true, unique=false)
*/
private $geolocation;

/**
* @var string
*
* @ORM\Column(name="ip", type="string", length=39, nullable=true, unique=false)
*/
private $ip;

/**
* @var string
*
* @ORM\Column(name="ip_mask", type="string", length=6, nullable=true, unique=false)
*/
private $ipMask;

/**
* @var BranchSync
*
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\BranchSync")
* @ORM\JoinColumn(name="branch_id", referencedColumnName="id")
**/
private $branch;

/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}

/**
* Set title
*
* @param string $title
*
* @return $this
*/
public function setTitle($title)
{
$this->title = $title;

return $this;
}

/**
* Get title
*
* @return string
*/
public function getTitle()
{
return $this->title;
}

/**
* @return string
*/
public function getDescription()
{
return $this->description;
}

/**
* @param string $description
* @return Room
*/
public function setDescription($description)
{
$this->description = $description;

return $this;
}

/**
* @return string
*/
public function getGeolocation()
{
return $this->geolocation;
}

/**
* @param string $geolocation
* @return Room
*/
public function setGeolocation($geolocation)
{
$this->geolocation = $geolocation;

return $this;
}

/**
* @return string
*/
public function getIp()
{
return $this->ip;
}

/**
* @param string $ip
*
* @return Room
*/
public function setIp($ip)
{
$this->ip = $ip;

return $this;
}

/**
* @return string
*/
public function getIpMask()
{
return $this->ipMask;
}

/**
* @param string $ipMask
*
* @return Room
*/
public function setIpMask($ipMask)
{
$this->ipMask = $ipMask;

return $this;
}

/**
* @return BranchSync
*/
public function getBranch()
{
return $this->branch;
}

/**
* @param BranchSync $branch
*
* @return $this
*/
public function setBranch($branch)
{
$this->branch = $branch;

return $this;
}
}

0 comments on commit cb3f1a4

Please sign in to comment.