original_string: public function getRelatedObjects()
      {
          // Not an easy task to fetch published objects with API and take care of current_version, status
          // and attribute version, so just use SQL to fetch all related object ids in one go
          $tagID = (int) $this->attribute( 'id' );
  
          $db = eZDB::instance();
          $result = $db->arrayQuery( "SELECT DISTINCT(o.id) AS object_id FROM eztags_attribute_link l
                                     INNER JOIN ezcontentobject o ON l.object_id = o.id
                                     AND l.objectattribute_version = o.current_version
                                     AND o.status = " . eZContentObject::STATUS_PUBLISHED . "
                                     WHERE l.keyword_id = $tagID" );
  
          if ( !is_array( $result ) || empty( $result ) )
              return array();
  
          $objectIDArray = array();
          foreach ( $result as $r )
          {
              $objectIDArray[] = $r['object_id'];
          }
  
          return eZContentObject::fetchIDArray( $objectIDArray );
      }
code: public function getRelatedObjects()
      {
          // Not an easy task to fetch published objects with API and take care of current_version, status
          // and attribute version, so just use SQL to fetch all related object ids in one go
          $tagID = (int) $this->attribute( 'id' );
  
          $db = eZDB::instance();
          $result = $db->arrayQuery( "SELECT DISTINCT(o.id) AS object_id FROM eztags_attribute_link l
                                     INNER JOIN ezcontentobject o ON l.object_id = o.id
                                     AND l.objectattribute_version = o.current_version
                                     AND o.status = " . eZContentObject::STATUS_PUBLISHED . "
                                     WHERE l.keyword_id = $tagID" );
  
          if ( !is_array( $result ) || empty( $result ) )
              return array();
  
          $objectIDArray = array();
          foreach ( $result as $r )
          {
              $objectIDArray[] = $r['object_id'];
          }
  
          return eZContentObject::fetchIDArray( $objectIDArray );
      }
code_tokens: public function getRelatedObjects ( ) { // Not an easy task to fetch published objects with API and take care of current_version, status // and attribute version, so just use SQL to fetch all related object ids in one go $ tagID = ( int ) $ this -> attribute ( 'id' ) ; $ db = eZDB :: instance ( ) ; $ result = $ db -> arrayQuery ( "SELECT DISTINCT(o.id) AS object_id FROM eztags_attribute_link l
                                     INNER JOIN ezcontentobject o ON l.object_id = o.id
                                     AND l.objectattribute_version = o.current_version
                                     AND o.status = " . eZContentObject :: STATUS_PUBLISHED . "
                                     WHERE l.keyword_id = $tagID" ) ; if ( ! is_array ( $ result ) || empty ( $ result ) ) return array ( ) ; $ objectIDArray = array ( ) ; foreach ( $ result as $ r ) { $ objectIDArray [ ] = $ r [ 'object_id' ] ; } return eZContentObject :: fetchIDArray ( $ objectIDArray ) ; }
docstring: Returns objects related to this tag
  
  @return eZContentObject[]
docstring_tokens: Returns objects related to this tag