Exemplo n.º 1
0
    function eZContentObject( $row )
    {
        $this->eZPersistentObject( $row );
        $this->ClassIdentifier = false;
        if ( isset( $row['contentclass_identifier'] ) )
            $this->ClassIdentifier = $row['contentclass_identifier'];
        $this->ClassName = false;
        if ( isset( $row['contentclass_name'] ) )
            $this->ClassName = $row['contentclass_name'];
        if ( isset( $row['serialized_name_list'] ) )
            $this->ClassName = eZContentClass::nameFromSerializedString( $row['serialized_name_list'] );

        $this->CurrentLanguage = false;
        if ( isset( $row['content_translation'] ) )
        {
            $this->CurrentLanguage = $row['content_translation'];
        }
        else if ( isset( $row['real_translation'] ) )
        {
            $this->CurrentLanguage = $row['real_translation'];
        }
        else if ( isset( $row['language_mask'] ) )
        {
            $topPriorityLanguage = eZContentLanguage::topPriorityLanguageByMask( $row['language_mask'] );
            if ( $topPriorityLanguage )
            {
               $this->CurrentLanguage = $topPriorityLanguage->attribute( 'locale' );
            }
        }
    }
Exemplo n.º 2
0
 /**
  * Initializes the object with $row.
  *
  * If $row is an integer, it will try to fetch it from the database using it as the unique ID.
  *
  * @param int|array $row
  */
 function eZContentObject($row)
 {
     $this->eZPersistentObject($row);
     $this->ClassIdentifier = false;
     if (isset($row['contentclass_identifier'])) {
         $this->ClassIdentifier = $row['contentclass_identifier'];
     }
     if (isset($row['class_identifier'])) {
         $this->ClassIdentifier = $row['class_identifier'];
     }
     $this->ClassName = false;
     // Depending on how the information is retrieved, the "serialized_name_list" is sometimes available in "class_serialized_name_list" key
     if (isset($row['class_serialized_name_list'])) {
         $row['serialized_name_list'] = $row['class_serialized_name_list'];
     }
     // Depending on how the information is retrieved, the "contentclass_name" is sometimes available in "class_name" key
     if (isset($row['class_name'])) {
         $row['contentclass_name'] = $row['class_name'];
     }
     if (isset($row['contentclass_name'])) {
         $this->ClassName = $row['contentclass_name'];
     }
     if (isset($row['serialized_name_list'])) {
         $this->ClassName = eZContentClass::nameFromSerializedString($row['serialized_name_list']);
     }
     $this->CurrentLanguage = false;
     if (isset($row['content_translation'])) {
         $this->CurrentLanguage = $row['content_translation'];
     } else {
         if (isset($row['real_translation'])) {
             $this->CurrentLanguage = $row['real_translation'];
         } else {
             if (isset($row['language_mask'])) {
                 $topPriorityLanguage = eZContentLanguage::topPriorityLanguageByMask($row['language_mask']);
                 if ($topPriorityLanguage) {
                     $this->CurrentLanguage = $topPriorityLanguage->attribute('locale');
                 }
             }
         }
     }
     // Initialize the permission array cache
     $this->Permissions = array();
 }