本文整理汇总了PHP中Phone::hasPrivate方法的典型用法代码示例。如果您正苦于以下问题:PHP Phone::hasPrivate方法的具体用法?PHP Phone::hasPrivate怎么用?PHP Phone::hasPrivate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Phone
的用法示例。
在下文中一共展示了Phone::hasPrivate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: format
public function format()
{
$this->text = trim($this->text);
$this->phones = Phone::formatFormArray($this->phones, $this->error, $this->pub);
if ($this->removed == 1) {
if (!S::user()->checkPerms('directory_private') && Phone::hasPrivate($this->phones)) {
Platal::page()->trigWarning("L'adresse ne peut être supprimée car elle contient des informations pour lesquelles vous n'avez le droit d'édition.");
} else {
$this->text = '';
return true;
}
}
$this->formatPostalAddress();
if ($this->changed == 1) {
$gmapsGeocoder = new GMapsGeocoder();
$gmapsGeocoder->getGeocodedAddress($this);
$componants = array();
foreach ($this->components as $component) {
$componants[] = Geocoder::getComponentId($component);
}
$this->componentsIds = implode(',', $componants);
}
if ($this->componentsIds == '') {
$this->latitude = null;
$this->longitude = null;
}
return true;
}
示例2: value
public function value(ProfilePage $page, $field, $value, &$success)
{
$entreprise = ProfileValidate::get_typed_requests($page->pid(), 'entreprise');
$entr_val = 0;
$init = false;
if (is_null($value)) {
$value = $this->fetchJobs($page);
$init = true;
}
$success = true;
foreach ($value as $key => $job) {
$job['name'] = trim($job['name']);
if ($job['name'] == '' && $entreprise[$entr_val]->id == $key) {
$job['tmp_name'] = $entreprise[$entr_val]->name;
++$entr_val;
} else {
if ($job['name'] == '') {
if ($job['description'] == '' && $job['w_url'] == '' && $job['w_address']['text'] == '' && $job['w_email'] == '' && count($job['w_phone']) >= 1 && $job['w_phone'][0]['display'] == '') {
unset($value[$key]);
continue;
}
if (!$init) {
$job['name_error'] = true;
$success = false;
}
}
}
if (isset($job['removed']) && $job['removed']) {
if (!S::user()->checkPerms('directory_private') && (Phone::hasPrivate($job['w_phone']) || Address::hasPrivate($job['w_address']) || $job['w_email_pub'] == 'private')) {
Platal::page()->trigWarning("L'entreprise ne peut être supprimée car elle contient des informations pour lesquelles vous n'avez pas le droit d'édition.");
} else {
if ($job['name'] == '' && $entreprise && isset($entreprise[$entr_val - 1])) {
$entreprise[$entr_val - 1]->clean();
}
unset($value[$key]);
continue;
}
}
if (!isset($job['pub']) || !$job['pub']) {
$job['pub'] = 'private';
}
$value[$key] = $job;
}
foreach ($value as $key => &$job) {
$address = new Address($job['w_address']);
$s = $address->format();
// Force the address publicity to be at least as restricted as
// the job publicity.
$job_level = $job['pub'];
if (Visibility::isLessRestrictive($job_level, $address->pub)) {
$address->pub = $job_level;
}
$job['w_address'] = $address->toFormArray();
$this->cleanJob($page, $key, $job, $s, $job_level);
if (!$init) {
$success = $success && $s;
}
}
usort($value, 'Visibility::comparePublicity');
return $value;
}