Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 5bd39c38 authored by NINASSI Benjamin's avatar NINASSI Benjamin
Browse files

adding secondaryType of structures

parent 497ff7f0
Branches
No related tags found
No related merge requests found
...@@ -78,6 +78,11 @@ class ImportStructuresFromJsonCommand extends ContainerAwareCommand ...@@ -78,6 +78,11 @@ class ImportStructuresFromJsonCommand extends ContainerAwareCommand
}else{ }else{
$logo =""; $logo ="";
} }
if($data_structure['structureType']){
$secondaryType = ltrim(rtrim($data_structure['structureType']));
}else{
$secondaryType ="";
}
if($data_structure['url']){ if($data_structure['url']){
$url = ltrim(rtrim($data_structure['url'])); $url = ltrim(rtrim($data_structure['url']));
}else{ }else{
...@@ -120,6 +125,7 @@ class ImportStructuresFromJsonCommand extends ContainerAwareCommand ...@@ -120,6 +125,7 @@ class ImportStructuresFromJsonCommand extends ContainerAwareCommand
$structure->setMainType($type); $structure->setMainType($type);
} }
if(($structure->getLogo() != $logo)|| if(($structure->getLogo() != $logo)||
($structure->getSecondaryType() != $secondaryType)||
($structure->getUrl() != $url)|| ($structure->getUrl() != $url)||
($structure->getWho()!=$who)|| ($structure->getWho()!=$who)||
($structure->getAddress() != $address)|| ($structure->getAddress() != $address)||
...@@ -129,6 +135,7 @@ class ImportStructuresFromJsonCommand extends ContainerAwareCommand ...@@ -129,6 +135,7 @@ class ImportStructuresFromJsonCommand extends ContainerAwareCommand
($structure->getEmail() != $email)){ ($structure->getEmail() != $email)){
$structure->setLogo($logo); $structure->setLogo($logo);
$structure->setSecondaryType($secondaryType);
$structure->setUrl($url); $structure->setUrl($url);
$structure->setWho($who); $structure->setWho($who);
$structure->setEmail($email); $structure->setEmail($email);
......
...@@ -36,11 +36,19 @@ class StructureController extends Controller ...@@ -36,11 +36,19 @@ class StructureController extends Controller
{ {
$em = $this->getDoctrine()->getManager(); $em = $this->getDoctrine()->getManager();
$type = $request->query->get('type'); $type = $request->query->get('type');
if(!$type){ $secondaryType = $request->query->get('secondaryType');
$queryArray = array();
if($type){
$queryArray['mainType'] = $type;
}
if($secondaryType){
$queryArray['secondaryType'] = $secondaryType;
}
if(sizeof($queryArray) == 0){
$structures = $em->getRepository('ClassCodeBundle:Structure')->findAll(); $structures = $em->getRepository('ClassCodeBundle:Structure')->findAll();
}else{ }else{
$structures = $em->getRepository('ClassCodeBundle:Structure')->findby( $structures = $em->getRepository('ClassCodeBundle:Structure')->findby(
array('mainType' => $type) $queryArray
); );
} }
......
...@@ -104,6 +104,13 @@ class Structure ...@@ -104,6 +104,13 @@ class Structure
*/ */
private $mainType = 'Partenaire ClassCode'; private $mainType = 'Partenaire ClassCode';
/**
* @var string $secondaryType
*
* @ORM\Column(name="secondaryType", type="string", length=255, nullable=true)
*/
private $secondaryType ;
/** /**
* @var string $dataSource * @var string $dataSource
* *
...@@ -339,7 +346,30 @@ class Structure ...@@ -339,7 +346,30 @@ class Structure
{ {
return $this->mainType; return $this->mainType;
} }
/**
* Set secondaryType
*
* @param string $secondaryType
* @return Structure
*/
public function setSecondaryType($secondaryType)
{
$this->secondaryType = $secondaryType;
return $this;
}
/**
* Get secondaryType
*
* @return string
*/
public function getSecondaryType()
{
return $this->secondaryType;
}
/** /**
* Set dataSource * Set dataSource
* *
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment