protected $strSerializedTZ;
337131
public function serialize()
    {
        $tz = $this->getTimezone();
        if ($tz && in_array($tz->getName(), timezone_identifiers_list())) {
            $strTz = $tz->getName();
            $strDate = parent::format('Y-m-d H:i:s');
        } else {
            $strTz = null;
            $strDate = parent::format(QDateTime::ISO8601);
        }
        return serialize([
            1, // version number of serialized data, in case format changes
            $this->blnDateNull,
            $this->blnTimeNull,
            $strDate,
            $strTz
        ]);
    }
698247
public function serialize()
    {
        $args = join(' ', $this->args);

        // nargs must be last and only 1

        $options = [];
        $narg = null;
        foreach ($this->options as $option => $value) {
            if (is_array($value)) {
                $narg = "$option ".join(' ', array_map('strval', $value));
                continue;
            }

            if (is_numeric($option)) {
                $options[] = strval($value);
            } elseif (is_bool($value)) {
                $options[] = $option;
            } else {
                $options[] = trim("$option $value");
            }
        }

        if (!is_null($narg)) {
            array_push($options, $narg);
        }

        return trim(preg_replace('/[\s]{2,}/', ' ', "{$this->binary} $args ".join(' ', $options)) ?: '');
    }
848213
public function process(): string
    {
        while ($this->string->valid()) {
            $this->handleTxt();
            $this->handleComment();
            $this->handleMultiline();
            $this->append();
        }

        $this->removeWhitespace();

        return $this->normalisedString;
    }
1148217
public function toBinary()
    {
        /**
         * @todo There is no documentation on the reserved data, but this is how it seems to act. May need to change this.
         */
        if (!$this->tsPropertyArray && !$this->dialInData) {
            $binary = $this->encodeReservedData('');
        } elseif ($this->tsPropertyArray && $this->dialInData) {
            $binary = $this->encodeReservedData(self::RESERVED_DATA_VALUE['NPS_RDS']);
        }
1033522
public function encoded()
    {
        $encoded = collect();

        $this->each(function ($model) use (&$encoded) {
            $pool = Mention::pool($model);
            $encoded->push("{$pool->key}:{$model->getKey()}");
        });

        return $encoded->implode(',');
    }
792658
static function sGetMicrotime()
    {
        list ($usec, $sec) = explode(" ", microtime());
        return (( float )$usec + ( float )$sec);
    }
1253235
function createCreated() {
    if( !isset( $this->created['value']['year'] )  &&
        !isset( $this->created['value']['month'] ) &&
        !isset( $this->created['value']['day'] )   &&
        !isset( $this->created['value']['hour'] )  &&
        !isset( $this->created['value']['min'] )   &&
        !isset( $this->created['value']['sec'] ))
      return;
    $formatted  = $this->_format_date_time( $this->created['value'], 7 );
    $attributes = $this->_createParams( $this->created['params'] );
    return $this->_createElement( 'CREATED', $attributes, $formatted );
  }
347658
function GetCharSet()
	{
		//we will use ADO's builtin property charSet
		$this->charSet = @pg_client_encoding($this->_connectionID);
		if (!$this->charSet) {
			return false;
		} else {
			return $this->charSet;
		}
	}
76741
public function value()
    {
        $value = lego_default($this->getOriginalValue(), $this->default);
        foreach ($this->pipes as $pipe) {
            $value = $pipe->handle($value, $this->data, $this);
        }

        return new HtmlString((string) $value);
    }
717345
private function strcmpLowercaseFirst($str1, $str2)
    {
        $inversedStr1 = PHPExcel_Shared_String::StrCaseReverse($str1);
        $inversedStr2 = PHPExcel_Shared_String::StrCaseReverse($str2);

        return strcmp($inversedStr1, $inversedStr2);
    }
510198
protected function prepareValuesToSave()
    {
        $values = parent::prepareValuesToSave();
        if ($this->changePassword) {
            $password = null;
            foreach ($this->formProperties as $key => $property) {
                if ($property['uri'] == GenerisRdf::PROPERTY_USER_PASSWORD && isset($this->formProperties[$key]['formValue'])) {
                    $password = $this->formProperties[$key]['formValue'];
                    break;
                }
            }

            $values[GenerisRdf::PROPERTY_USER_PASSWORD] = core_kernel_users_Service::getPasswordHash()->encrypt($password);
        }

        return $values;
    }
584580
public function unserialize($serialized)
    {
        $data = unserialize($serialized);
        
        $this->autoNumber              =  $data['autoNumber'];            
        $this->byteLength              =  $data['byteLength'];            
        $this->calculated              =  $data['calculated'];            
        $this->calculatedFormula       =  $data['calculatedFormula'];     
        $this->caseSensitive           =  $data['caseSensitive'];         
        $this->controllerName          =  $data['controllerName'];        
        $this->createable              =  $data['createable'];            
        $this->custom                  =  $data['custom'];                
        $this->defaultValueFormula     =  $data['defaultValueFormula'];   
        $this->defaultedOnCreate       =  $data['defaultedOnCreate'];     
        $this->dependentPicklist       =  $data['dependentPicklist'];     
        $this->deprecatedAndHidden     =  $data['deprecatedAndHidden'];   
        $this->digits                  =  $data['digits'];                
        $this->externalId              =  $data['externalId'];            
        $this->filterable              =  $data['filterable'];            
        $this->groupable               =  $data['groupable'];             
        $this->htmlFormatted           =  $data['htmlFormatted'];         
        $this->idLookup                =  $data['idLookup'];              
        $this->inlineHelpText          =  $data['inlineHelpText'];        
        $this->label                   =  $data['label'];                 
        $this->length                  =  $data['length'];                
        $this->name                    =  $data['name'];                  
        $this->nameField               =  $data['nameField'];             
        $this->namePointing            =  $data['namePointing'];          
        $this->nillable                =  $data['nillable'];              
        $this->permissionable          =  $data['permissionable'];        
        $this->picklistValues          =  $data['picklistValues'];        
        $this->precision               =  $data['precision'];             
        $this->referenceTo             =  $data['referenceTo'];           
        $this->relationshipName        =  $data['relationshipName'];      
        $this->relationshipOrder       =  $data['relationshipOrder'];     
        $this->restrictedPicklist      =  $data['restrictedPicklist'];    
        $this->scale                   =  $data['scale'];                 
        $this->soapType                =  $data['soapType'];              
        $this->sortable                =  $data['sortable'];              
        $this->type                    =  $data['type'];                  
        $this->unique                  =  $data['unique'];                
        $this->updateable              =  $data['updateable'];            
        $this->writeRequiresMasterRead =  $data['writeRequiresMasterRead'];
    }
757905
protected function processEmbedsChanged()
    {
        $cache = $this->_cache;
        $attrs = $this->getAttrs();
        foreach ($cache as $key => $item) {
            if(!isset($attrs[$key])) continue;
            $attr = $attrs[$key];
            if ($attr['type'] == self::DATA_TYPE_EMBED) {
                $item->processEmbedsChanged();
                if ( $item instanceof Model && $this->cleanData[$key] !== $item->toArray()) {
                    $this->__setter($key, $item);
                }
            } elseif ($attr['type'] == self::DATA_TYPE_EMBEDS) {
                if ( $item instanceof Collection && $this->cleanData[$key] !== $item->toEmbedsArray()) {
                    $this->__setter($key, $item);
                }
            }
        }
    }
924084
public function ParseFromArray()
	{
		parent::ParseFromArray();

		$saved = $this->value;
		$this->value = round($this->value / 2);
		if ($saved % 2 == 1)
		{
			$this->value = -($this->value);
		}
	}
774677
private function _prepareLimit()
	{
		$sQuery = '';
		$limit = (int) $this->_iLimit;
		$iOffset = $this->_iOffset;

		if($limit != 0 || $iOffset > 0) { $sQuery .= ' LIMIT '; }

		if($iOffset > 0) { $sQuery .= $iOffset.', '.$limit; }
		else if($limit != 0) { $sQuery .= $limit.' '; }

		return $sQuery;
	}
480650
protected function stringifyParameters()
    {
        if (isset($this->parameters['PBX_HMAC'])) {
            unset($this->parameters['PBX_HMAC']);
        }

        ksort($this->parameters);

        return Tools::stringify($this->parameters);
    }
1350939
public function toString() {
		Theme::singleton()->updateElementClasses( $this );
		if ( $this->isInfusable() ) {
			$this->ensureInfusableId();
		}
		return parent::toString();
	}