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

ezsitedata enhancement (kernel/classes/ezsitedata.php)

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Medium Medium
    • Resolution: Obsolete
    • Affects Version/s: 4.3.0, 4.4.0, 4.5.0alpha
    • Fix Version/s: Customer request
    • Component/s: Misc
    • Labels:
      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;
      }
      

        Activity

        Hide
        ezrobot added a comment -

        This issue has been automatically closed due to the lack of activity over a long period of time. It is very likely that it is obsolete, but if you think it is still valid, do not hesitate to reopen it and mention why.

        Show
        ezrobot added a comment - This issue has been automatically closed due to the lack of activity over a long period of time. It is very likely that it is obsolete, but if you think it is still valid, do not hesitate to reopen it and mention why.

          People

          • Assignee:
            unknown
            Reporter:
            Jarosław-- Heba
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: