Commit 2cb72276 authored by Bertrand Gauthier's avatar Bertrand Gauthier
Browse files

Changement syntaxe PHP 5.4 -> 5.3.

parent a6d29378
......@@ -130,7 +130,7 @@ abstract class Entity
*/
public function getId()
{
$key = self::getNodeParams($this->type)[0];
list($key) = self::getNodeParams($this->type);
return $this->get($key);
}
......@@ -141,7 +141,7 @@ abstract class Entity
*/
public function getKey()
{
return self::getNodeParams($this->type)[0];
return reset(self::getNodeParams($this->type));
}
/**
......
......@@ -146,7 +146,7 @@ abstract class Service implements ServiceManagerAwareInterface
*/
public function getList( $orderBy=null, $limit=self::DEFAULT_LIMIT, $offset=self::DEFAULT_OFFSET )
{
$key = Entity::getNodeParams($this->type)[0];
list($key) = Entity::getNodeParams($this->type);
return $this->search( "($key=*)", $orderBy, $limit, $offset );
}
......@@ -161,7 +161,7 @@ abstract class Service implements ServiceManagerAwareInterface
*/
public function search( $filter, $orderBy=null, $limit=self::DEFAULT_LIMIT, $offset=self::DEFAULT_OFFSET )
{
$key = Entity::getNodeParams($this->type)[0];
list($key) = Entity::getNodeParams($this->type);
if ($limit < 0) $limit = 3999999999; // Limite maximum à 4 milliard...
if ($offset < 0) $offset = 0; // Moins de zéro = impossible
......@@ -186,7 +186,7 @@ abstract class Service implements ServiceManagerAwareInterface
$i = 0;
ErrorHandler::start(E_WARNING);
for ($entry=ldap_first_entry($resource,$search); $entry; $entry=ldap_next_entry($resource,$entry)) {
$value = ldap_get_values_len($resource,$entry,$key)[0];
list($value) = ldap_get_values_len($resource,$entry,$key);
if (null !== $value){
$result[] = $value;
$i++;
......@@ -233,7 +233,7 @@ abstract class Service implements ServiceManagerAwareInterface
*/
public function searchAttributes( $filter, array $attributes, $orderBy=null, $limit=self::DEFAULT_LIMIT, $offset=self::DEFAULT_OFFSET )
{
$key = Entity::getNodeParams($this->type)[0];
list($key) = Entity::getNodeParams($this->type);
if ($limit < 0) $limit = 3999999999; // Limite maximum à 4 milliard...
if ($offset < 0) $offset = 0; // Moins de zéro = impossible
......@@ -259,7 +259,7 @@ abstract class Service implements ServiceManagerAwareInterface
$i = 0;
ErrorHandler::start(E_WARNING);
for ($entry=ldap_first_entry($resource,$search); $entry; $entry=ldap_next_entry($resource,$entry)) {
$id = ldap_get_values_len($resource,$entry,$key)[0];
list($id) = ldap_get_values_len($resource,$entry,$key);
$data = array();
foreach( $attributes as $attribute ){
$attrValue = ldap_get_values_len($resource,$entry,$attribute);
......@@ -378,7 +378,7 @@ abstract class Service implements ServiceManagerAwareInterface
*/
public function get( $id )
{
$key = Entity::getNodeParams($this->type)[0];
list($key) = Entity::getNodeParams($this->type);
return $this->getBy( $id, $key );
}
......@@ -399,7 +399,7 @@ abstract class Service implements ServiceManagerAwareInterface
$value = current($value);
}
$classname = Entity::getNodeParams($this->type)[1];
list($tmp, $classname) = Entity::getNodeParams($this->type);
list( $resource, $search ) = $this->__searchBegin( Filter::equals($by, $value), $this->ou, array('*','+') );
$count = ldap_count_entries($resource, $search);
switch( $count ){
......@@ -428,7 +428,7 @@ abstract class Service implements ServiceManagerAwareInterface
*/
public function getAll( $ids, $orderBy=null )
{
$key = Entity::getNodeParams($this->type)[0];
list($key) = Entity::getNodeParams($this->type);
return $this->getAllBy($ids, $key, $orderBy);
}
......@@ -472,7 +472,7 @@ abstract class Service implements ServiceManagerAwareInterface
*/
public function exists( $id )
{
$key = Entity::getNodeParams($this->type)[0];
list($key) = Entity::getNodeParams($this->type);
return $this->existsBy($id, $key);
}
......@@ -507,7 +507,7 @@ abstract class Service implements ServiceManagerAwareInterface
*/
public function create( $id, $ou=null )
{
list($key,$classname) = Entity::getNodeParams($this->type);
list($key, $classname) = Entity::getNodeParams($this->type);
if (empty($ou)){
if (count($this->ou) > 1){
throw new Exception('$ou non renseigné alors que le service couvre plusieurs Organizational Units (OU).');
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment