Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-17893

ezsitedata enhancement (kernel/classes/ezsitedata.php)

    XMLWordPrintable

Details

    • Icon: Improvement Improvement
    • Resolution: Obsolete
    • Icon: Medium Medium
    • Customer request
    • 4.3.0, 4.4.0, 4.5.0alpha
    • Misc
    • None

    Description

      Please add those functions...

      /* Gets the value of a key 
      * 
      * @param $name Name of the key
      * @return Returns the value of a key or false of the key doesn`t exists
      */
      static function get( $name )
      {
      $data = eZPersistentObject::fetchObject( eZSiteData::definition(), null, array( 
      'name' => $name 
      ), true );
      if ( $data instanceof eZPersistentObject )
      {
      return $data->attribute( 'value' );
      }
      else
      {
      return false;
      }
      
      }
      
      /* Sets the value of a key
      * @param $name Name of the key
      * @param $value Value of the key
      * @return True on success
      */
      static function set( $name, $value )
      {
      $value = (string) $value;
      $data = eZPersistentObject::fetchObject( eZSiteData::definition(), null, array( 
      'name' => $name 
      ), true );
      if ( ! $data instanceof eZPersistentObject )
      {
      $row = array( 
      'name' => $name , 
      'value' => $value 
      );
      $data = new eZSiteData( $row );
      return $data->store();
      }
      elseif ( $data instanceof eZPersistentObject and $value !== $data->attribute( 'value' ) )
      {
      $data->setAttribute( 'value', $value );
      return $data->store();
      }
      return true;
      }
      

      Attachments

        Activity

          People

            unknown unknown
            2b274289-6c7c-4b95-a70d-ca6c4a846602@accounts.ibexa.co j h
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: