[ Index ]

PHP Cross Reference of vtigercrm-6.1.0

title

Body

[close]

/modules/Vtiger/models/ -> CssScript.php (source)

   1  <?php
   2  /*+***********************************************************************************
   3   * The contents of this file are subject to the vtiger CRM Public License Version 1.0
   4   * ("License"); You may not use this file except in compliance with the License
   5   * The Original Code is:  vtiger CRM Open Source
   6   * The Initial Developer of the Original Code is vtiger.
   7   * Portions created by vtiger are Copyright (C) vtiger.
   8   * All Rights Reserved.
   9   *************************************************************************************/
  10  
  11  /**
  12   * CSS Script Model Class
  13   */
  14  class Vtiger_CssScript_Model extends Vtiger_Base_Model {
  15  
  16      const DEFAULT_REL = 'stylesheet';
  17      const DEFAULT_MEDIA = 'screen';
  18      const DEFAULT_TYPE = 'text/css';
  19  
  20      const LESS_REL = 'stylesheet/less';
  21  
  22      /**
  23       * Function to get the rel attribute value
  24       * @return <String>
  25       */
  26  	public function getRel(){
  27          $rel = $this->get('rel');
  28          if(empty($rel)){
  29              $rel = self::DEFAULT_REL;
  30          }
  31          return $rel;
  32      }
  33  
  34      /**
  35       * Function to get the media attribute value
  36       * @return <String>
  37       */
  38  	public function getMedia(){
  39          $media = $this->get('media');
  40          if(empty($media)){
  41              $media = self::DEFAULT_MEDIA;
  42          }
  43          return $media;
  44      }
  45  
  46      /**
  47       * Function to get the type attribute value
  48       * @return <String>
  49       */
  50  	public function getType(){
  51          $type = $this->get('type');
  52          if(empty($type)){
  53              $type = self::DEFAULT_TYPE;
  54          }
  55          return $type;
  56      }
  57  
  58      /**
  59       * Function to get the href attribute value
  60       * @return <String>
  61       */
  62  	public function getHref() {
  63          $href = $this->get('href');
  64          if(empty($href)) {
  65              $href = $this->get('linkurl');
  66          }
  67          return $href;
  68      }
  69  
  70      /**
  71       * Function to get the instance of CSS Script model from a given Vtiger_Link object
  72       * @param Vtiger_Link $linkObj
  73       * @return Vtiger_CssScript_Model instance
  74       */
  75  	public static function getInstanceFromLinkObject (Vtiger_Link $linkObj){
  76          $objectProperties = get_object_vars($linkObj);
  77          $linkModel = new self();
  78          foreach($objectProperties as $properName=>$propertyValue){
  79              $linkModel->$properName = $propertyValue;
  80          }
  81          return $linkModel->setData($objectProperties);
  82      }
  83  
  84  }


Generated: Fri Nov 28 20:08:37 2014 Cross-referenced by PHPXref 0.7.1