PluginProbe ʕ •ᴥ•ʔ
VikAppointments Services Booking Calendar / 1.2.21
VikAppointments Services Booking Calendar v1.2.21
1.2.21 1.2.20 trunk 1.2.17 1.2.18 1.2.19
vikappointments / site / helpers / libraries / customfields / rules / company.php
vikappointments / site / helpers / libraries / customfields / rules Last commit date
address.php 3 days ago city.php 3 days ago company.php 3 days ago country.php 3 days ago email.php 3 days ago index.html 3 days ago nominative.php 3 days ago pec.php 3 days ago phone.php 3 days ago ssn.php 3 days ago state.php 3 days ago vatnum.php 3 days ago zip.php 3 days ago
company.php
52 lines
1 <?php
2 /**
3 * @package VikAppointments
4 * @subpackage core
5 * @author E4J s.r.l.
6 * @copyright Copyright (C) 2021 E4J s.r.l. All Rights Reserved.
7 * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
8 * @link https://vikwp.com
9 */
10
11 // No direct access
12 defined('ABSPATH') or die('No script kiddies please!');
13
14 /**
15 * VikAppointments custom field company name rule dispatcher.
16 *
17 * @since 1.7
18 */
19 class VAPCustomFieldRuleCompany extends VAPCustomFieldRule
20 {
21 /**
22 * Returns the name of the rule.
23 *
24 * @return string
25 */
26 public function getName()
27 {
28 return JText::translate('VAPCUSTFIELDRULE8');
29 }
30
31 /**
32 * Dispatches the field rule.
33 *
34 * @param mixed $value The value of the field set in request.
35 * @param array &$args The array data to fill-in in case of
36 * specific rules (name, e-mail, etc...).
37 * @param mixed $field The custom field object.
38 *
39 * @return void
40 */
41 public function dispatch($value, &$args, $field)
42 {
43 // in case of multiple fields with company rule, use only
44 // the first specified one
45 if (empty($args['company']))
46 {
47 // fill company column with field value
48 $args['company'] = $value;
49 }
50 }
51 }
52