You are here

public function SocialContent::prepareRow in Social Content 7.2

Prepare the row for import.

This is where you should structure your fields and make sure your row contains the important properties such as id and created.

Parameters

object $row: The row to prepare.

Return value

bool FALSE to skip this row else TRUE to import row.

12 calls to SocialContent::prepareRow()
SocialContent::import in ./social_content.class.inc
Do the import.
SocialContentFacebook::prepareRow in modules/facebook/social_content_facebook.class.inc
Do the uploads and attach expected fields to a row about to be imported.
SocialContentFlickr::prepareRow in modules/flickr/social_content_flickr.class.inc
Do the uploads and attach expected fields to a row about to be imported.
SocialContentInstagram::prepareRow in modules/instagram/social_content_instagram.class.inc
Do the uploads and attach expected fields to a row about to be imported.
SocialContentLinkedin::prepareRow in modules/linkedin/social_content_linkedin.class.inc
Do the uploads and attach expected fields to a row about to be imported.

... See full list

11 methods override SocialContent::prepareRow()
SocialContentFacebook::prepareRow in modules/facebook/social_content_facebook.class.inc
Do the uploads and attach expected fields to a row about to be imported.
SocialContentFlickr::prepareRow in modules/flickr/social_content_flickr.class.inc
Do the uploads and attach expected fields to a row about to be imported.
SocialContentInstagram::prepareRow in modules/instagram/social_content_instagram.class.inc
Do the uploads and attach expected fields to a row about to be imported.
SocialContentLinkedin::prepareRow in modules/linkedin/social_content_linkedin.class.inc
Do the uploads and attach expected fields to a row about to be imported.
SocialContentPicasa::prepareRow in modules/picasa/social_content_picasa.class.inc
Do the uploads and attach expected fields to a row about to be imported.

... See full list

File

./social_content.class.inc, line 809
Social Content class.

Class

SocialContent
TODO: Table names should be a property for ease of change Separate this class into smaller classes.

Code

public function prepareRow($row) {
  $exists = db_select('social_content_history', 'social_content_history')
    ->fields('social_content_history', array(
    'internal_id',
  ))
    ->condition('external_id', $row->id)
    ->condition('instance', $this->settings['instance']['id'])
    ->execute()
    ->fetchField();
  if ($exists) {
    watchdog('social_content', '%global : %id already exists', array(
      '%global' => $this
        ->getMachineName(),
      '%id' => $row->id,
    ));
  }
  return !$exists;
}