function get_tenant_by_name($name) { _deprecated_notice(__METHOD__, '1.1.1'); $ci =& get_instance(); $tenant = $ci->db->from('tenants as i')->where('i.name', $name)->get()->result(); if (!empty($tenant[0])) { return $tenant[0]; } return false; }
public static function message($group, $code) { _deprecated_notice(__METHOD__, '1.2', 'Use Exception messages directly.'); $message = null; $error_group = null; if (property_exists('ErrorMessages', $group)) { $error_group = self::${$group}; } if (is_array($error_group)) { $message = isset($error_group[$code]) ? $error_group[$code] : "Unknown Error: {$code}"; } if (is_null($message)) { $message = 'Unknown Error'; } return $message; }
/** * Create the proper verb for the Picker's value * * @deprecated use AudioSpeechPickerWidget::setVerbForValue instead * @param mixed $value * @param object $defaultVerb * @return object subclass of Verb */ public static function getVerbForValue($value, $defaultVerb) { _deprecated_notice(__METHOD__, '1.0.4', 'AudioSpeechPickerWidget::setVerbForValue'); $matches = array(); if (empty($value)) { return $defaultVerb; } else { if (preg_match('/^vbx-audio-upload:\\/\\/(.*)/i', $value, $matches)) { // This is a locally hosted file, and we need to return the correct // absolute URL for the file. return new Play(asset_url("audio-uploads/" . $matches[1])); } else { if (preg_match('/^http(s)?:\\/\\/(.*)/i', $value)) { // it's already an absolute URL return new Play($value); } else { return new Say($value); } } } }
public function save($force_update = false) { if (isset($this->last_seen)) { $replacement = "VBX_User::setting('last_seen', new MY_ModelLiteral('UTC_TIMESTAMP()'))"; _deprecated_notice(__CLASS__ . '::$last_seen', '1.1.2', $replacement); } if (strlen($this->email) < 0) { throw new VBX_UserException('Email is a required field.'); } if (!(strpos($this->email, '@') > 0)) { throw new VBX_UserException('Valid email address is required'); } if (!strlen($this->voicemail)) { $this->voicemail = ''; } $ci =& get_instance(); if (is_string($this->auth_type) && !is_numeric($this->auth_type)) { $results = $ci->db->from('auth_types')->where('description', $this->auth_type)->get()->result(); if (empty($results)) { throw new VBX_UserException('AuthType does not exist.'); } $this->auth_type = $results[0]->id; } return parent::save($force_update); }
function __construct($id, $token) { // Deprecatation Notice _deprecated_notice(__CLASS__, '1.0.4'); $this->AuthToken = $token; $this->AccountSid = $id; foreach (array('CallSid', 'Caller', 'Called', 'CallStatus', 'DialStatus', 'Digits', 'Duration', 'RecordingUrl', 'TranscriptionText', 'SmsSid', 'To', 'SmsMessageSid', 'From', 'CallDuration', 'RecordingDuration', 'DialCallStatus', 'DialCallDuration') as $field) { $this->{$field} = isset($_REQUEST[$field]) ? $_REQUEST[$field] : FALSE; } if ($this->Digits) { $trimmed = str_replace(array('#', '*'), '', $this->Digits); if (strlen($trimmed) > 0) { $this->DigitNumbers = $trimmed; } } }