public function __construct($number, $num_type = self::NUM_ANY, $phone_type = self::PHONE_ANY)
{
- require_once('profil.inc.php');
+ require_once('profil.func.inc.php');
$this->number = $number;
$this->num_type = $num_type;
$this->phone_type = format_phone_number($phone_type);
* The 'register_optional' function can be used to generate unique table aliases when
* the same table has to be joined several times with different aliases.
*/
-class UserFilter
+class UserFilter extends PlFilter
{
- private $joinMethods = array();
+ protected $joinMethods = array();
- private $joinMetas = array('$PID' => 'p.pid',
- '$UID' => 'a.uid',
- );
+ protected $joinMetas = array('$PID' => 'p.pid',
+ '$UID' => 'a.uid',
+ );
private $root;
private $sort = array();
}
}
- public function setCondition(UserFilterCondition &$cond)
+ public function setCondition(PlFilterCondition &$cond)
{
$this->root =& $cond;
$this->query = null;
}
- public function addSort(UserFilterOrder &$sort)
+ public function addSort(PlFilterOrder &$sort)
{
$this->sort[] = $sort;
$this->orderby = null;
} else {
$max = new UFC_True();
}
- return new UserFilter(new UFC_And($min, $max));
+ return new UserFilter(new PFC_And($min, $max));
}
static public function sortByName()
return '';
}
- private function displayJoins()
+ protected function displayJoins()
{
if ($this->pd) {
return array('pd' => new PlSqlJoin(PlSqlJoin::MODE_LEFT, 'profile_display', '$ME.pid = $PID'));
static public function assertName($name)
{
if (!Profile::getNameTypeId($name)) {
- Platal::page()->kill('Invalid name type');
+ Platal::page()->kill('Invalid name type: ' . $name);
}
}
return $sub;
}
- private function nameJoins()
+ protected function nameJoins()
{
$joins = array();
foreach ($this->pn as $sub => $type) {
return $sub;
}
- private function educationJoins()
+ protected function educationJoins()
{
$joins = array();
if ($this->with_pee) {
return $sub;
}
- private function groupJoins()
+ protected function groupJoins()
{
$joins = array();
foreach ($this->gpm as $sub => $key) {
return $this->register_optional($this->al, $alias);
}
- private function emailJoins()
+ protected function emailJoins()
{
global $globals;
$joins = array();
return 'pa';
}
- private function addressJoins()
+ protected function addressJoins()
{
$joins = array();
if ($this->with_pa) {
return 'pcr';
}
- private function corpsJoins()
+ protected function corpsJoins()
{
$joins = array();
if ($this->pc) {
}
}
- private function jobJoins()
+ protected function jobJoins()
{
$joins = array();
if ($this->with_pj) {
return 'pnw';
}
- private function networkingJoins()
+ protected function networkingJoins()
{
$joins = array();
if ($this->with_pnw) {
return 'ptel';
}
- private function phoneJoins()
+ protected function phoneJoins()
{
$joins = array();
if ($this->with_ptel) {
- $joins['ptel'] = new PlSqlJoin(PlSqlJoin::MODE_LEFT, 'profile_phone', '$ME.uid = $UID');
+ $joins['ptel'] = new PlSqlJoin(PlSqlJoin::MODE_LEFT, 'profile_phones', '$ME.uid = $UID');
}
return $joins;
}
return 'pmed';
}
- private function medalJoins()
+ protected function medalJoins()
{
$joins = array();
if ($this->with_pmed) {
}
}
- private function mentorJoins()
+ protected function mentorJoins()
{
$joins = array();
foreach ($this->pms as $sub => $tab) {
return $this->register_optional($this->cts, is_null($uid) ? null : 'user_' . $uid);
}
- private function contactJoins()
+ protected function contactJoins()
{
$joins = array();
foreach ($this->cts as $sub=>$key) {
return $this->register_optional($this->w, is_null($uid) ? null : 'user_' . $uid);
}
- private function watchJoins()
+ protected function watchJoins()
{
$joins = array();
foreach ($this->w as $sub=>$key) {