You are here

public static function PHPExcel_DocumentProperties::convertProperty in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/DocumentProperties.php \PHPExcel_DocumentProperties::convertProperty()
2 calls to PHPExcel_DocumentProperties::convertProperty()
PHPExcel_Reader_Excel2007::load in vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/Excel2007.php
* Loads PHPExcel from file * *
PHPExcel_Reader_OOCalc::loadIntoExisting in vendor/phpoffice/phpexcel/Classes/PHPExcel/Reader/OOCalc.php
* Loads PHPExcel from file into PHPExcel instance * *

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/DocumentProperties.php, line 477

Class

PHPExcel_DocumentProperties
PHPExcel_DocumentProperties

Code

public static function convertProperty($propertyValue, $propertyType) {
  switch ($propertyType) {
    case 'empty':

      //    Empty
      return '';
      break;
    case 'null':

      //    Null
      return NULL;
      break;
    case 'i1':

    //    1-Byte Signed Integer
    case 'i2':

    //    2-Byte Signed Integer
    case 'i4':

    //    4-Byte Signed Integer
    case 'i8':

    //    8-Byte Signed Integer
    case 'int':

      //    Integer
      return (int) $propertyValue;
      break;
    case 'ui1':

    //    1-Byte Unsigned Integer
    case 'ui2':

    //    2-Byte Unsigned Integer
    case 'ui4':

    //    4-Byte Unsigned Integer
    case 'ui8':

    //    8-Byte Unsigned Integer
    case 'uint':

      //    Unsigned Integer
      return abs((int) $propertyValue);
      break;
    case 'r4':

    //    4-Byte Real Number
    case 'r8':

    //    8-Byte Real Number
    case 'decimal':

      //    Decimal
      return (double) $propertyValue;
      break;
    case 'lpstr':

    //    LPSTR
    case 'lpwstr':

    //    LPWSTR
    case 'bstr':

      //    Basic String
      return $propertyValue;
      break;
    case 'date':

    //    Date and Time
    case 'filetime':

      //    File Time
      return strtotime($propertyValue);
      break;
    case 'bool':

      //    Boolean
      return $propertyValue == 'true' ? True : False;
      break;
    case 'cy':

    //    Currency
    case 'error':

    //    Error Status Code
    case 'vector':

    //    Vector
    case 'array':

    //    Array
    case 'blob':

    //    Binary Blob
    case 'oblob':

    //    Binary Blob Object
    case 'stream':

    //    Binary Stream
    case 'ostream':

    //    Binary Stream Object
    case 'storage':

    //    Binary Storage
    case 'ostorage':

    //    Binary Storage Object
    case 'vstream':

    //    Binary Versioned Stream
    case 'clsid':

    //    Class ID
    case 'cf':

      //    Clipboard Data
      return $propertyValue;
      break;
  }
  return $propertyValue;
}