{
private $hruids;
- public function __construct($val)
+ public function __construct()
{
- if (!is_array($val)) {
- $val = array($val);
- }
- $this->hruids = $val;
+ $this->hruids = pl_flatten(func_get_args());
}
public function buildCondition(PlFilter &$uf)
{
private $hrpids;
- public function __construct($val)
+ public function __construct()
{
- if (!is_array($val)) {
- $val = array($val);
- }
- $this->hrpids = $val;
+ $this->hrpids = pl_flatten(func_get_args());
}
public function buildCondition(PlFilter &$uf)
{
private $val;
- public function __construct($val)
+ public function __construct()
{
- if (!is_array($val)) {
- $val = array($val);
- }
- $this->val = $val;
+ $this->val = pl_flatten(func_get_args());
}
public function buildCondition(PlFilter &$uf)
{
private $diploma;
- public function __construct($diploma)
+ public function __construct()
{
- if (! is_array($diploma)) {
- $diploma = array($diploma);
- }
- $this->diploma = $diploma;
+ $this->diploma = pl_flatten(func_get_args());
}
public function buildCondition(PlFilter &$uf)
{
private $val;
- public function __construct($val)
+ public function __construct()
{
- if (!is_array($val)) {
- $val = array($val);
- }
- $this->val = $val;
+ $this->val = pl_flatten(func_get_args());
}
public function buildCondition(PlFilter &$uf)
{
private $val;
- public function __construct($val)
+ public function __construct()
{
- if (!is_array($val)) {
- $val = array($val);
- }
- $this->val = $val;
+ $this->val = pl_flatten(func_get_args());
}
public function buildCondition(PlFilter &$uf)
{
private $val;
- public function __construct($val)
+ public function __construct()
{
- if (!is_array($val)) {
- $val = array($val);
- }
- $this->val = $val;
+ $this->val = pl_flatten(func_get_args());
}
public function buildCondition(PlFilter &$uf)
{
private $section;
- public function __construct($section)
+ public function __construct()
{
- $this->section = $section;
+ $this->section = pl_flatten(func_get_args());
}
public function buildCondition(PlFilter &$uf)
{
$uf->requireProfiles();
- return 'p.section = ' . XDB::format('{?}', $this->section);
+ return XDB::format('p.section IN {?}', $this->section);
}
}
// }}}
private $emails;
public function __construct()
{
- $this->emails = func_get_args();
+ $this->emails = pl_flatten(func_get_args());
}
public function buildCondition(PlFilter &$uf)
{
private $country;
- public function __construct($country)
+ public function __construct()
{
- $this->country = $country;
+ $this->country = pl_flatten(func_get_args());
}
public function buildCondition(PlFilter &$uf)
{
$sub = $uf->addMentorFilter(UserFilter::MENTOR_COUNTRY);
- return $sub . '.country = ' . XDB::format('{?}', $this->country);
+ return $sub . '.country IN ' . XDB::format('{?}', $this->country);
}
}
// }}}
FROM accounts
WHERE hruid IN {?}', array('florent.bruneau.2003',
'stephane.jacob.2004')),
- new UFC_Hruid(array('florent.bruneau.2003', 'stephane.jacob.2004')), 2),
+ new UFC_Hruid('florent.bruneau.2003', 'stephane.jacob.2004'), 2),
array(XDB::format('SELECT DISTINCT uid
FROM accounts
WHERE hruid IN {?}', array('florent.bruneau.2004',
'stephane.jacob.2004')),
- new UFC_Hruid(array('florent.bruneau.2004', 'stephane.jacob.2004')), 1),
+ new UFC_Hruid('florent.bruneau.2004', 'stephane.jacob.2004'), 1),
/* UFC_Hrpid
*/
INNER JOIN profiles AS p ON (ap.pid = p.pid AND FIND_IN_SET(\'owner\', perms))
WHERE hrpid IN {?}', array('florent.bruneau.2003',
'stephane.jacob.2004')),
- new UFC_Hrpid(array('florent.bruneau.2003', 'stephane.jacob.2004')), 2),
+ new UFC_Hrpid('florent.bruneau.2003', 'stephane.jacob.2004'), 2),
array(XDB::format('SELECT DISTINCT uid
FROM account_profiles AS ap
INNER JOIN profiles AS p ON (ap.pid = p.pid AND FIND_IN_SET(\'owner\', perms))
WHERE hrpid IN {?}', array('florent.bruneau.2004',
'stephane.jacob.2004')),
- new UFC_Hrpid(array('florent.bruneau.2004', 'stephane.jacob.2004')), 1),
+ new UFC_Hrpid('florent.bruneau.2004', 'stephane.jacob.2004'), 1),
/* UFC_IP
*/
INNER JOIN profile_education AS pe ON (pe.pid = ap.pid AND FIND_IN_SET(\'owner\', ap.perms))
LEFT JOIN profile_education_enum AS pee ON (pe.eduid = pee.id)
WHERE pee.abbreviation IN {?}', array('X', 'HEC')),
- new UFC_EducationSchool(array($id_X, $id_HEC)), -1),
+ new UFC_EducationSchool($id_X, $id_HEC), -1),
);
/* UFC_EducationDegree
INNER JOIN profile_education AS pe ON (pe.pid = ap.pid AND FIND_IN_SET(\'owner\', ap.perms))
LEFT JOIN profile_education_degree_enum AS pede ON (pe.degreeid = pede.id)
WHERE pede.abbreviation IN {?}', array('Ing.', 'PhD')),
- new UFC_EducationDegree(array($id_DegreeIng, $id_DegreePhd)), -1),
+ new UFC_EducationDegree($id_DegreeIng, $id_DegreePhd), -1),
);
/* UFC_EducationField
*/
INNER JOIN profile_education AS pe ON (pe.pid = ap.pid AND FIND_IN_SET(\'owner\', ap.perms))
LEFT JOIN profile_education_field_enum AS pefe ON (pe.fieldid = pefe.id)
WHERE pefe.field IN {?}', array('Informatique', 'Droit')),
- new UFC_EducationField(array($id_FieldInfo, $id_FieldDroit)), 0), // FIXME: should be -1
+ new UFC_EducationField($id_FieldInfo, $id_FieldDroit), 0), // FIXME: should be -1
);
$testcases = array();