Skip to content

Instantly share code, notes, and snippets.

@Osukaru
Created October 3, 2012 13:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Osukaru/3826897 to your computer and use it in GitHub Desktop.
Save Osukaru/3826897 to your computer and use it in GitHub Desktop.
public function fetchByCountryBrand($countryBrandId, $providerName = 'mpx')
{
$select = $this->select(true)
->join('album', 'album_id = video_album_id', array())
->join('serie', 'serie_id = album_serie_id', array())
->where('video_status = 1')
->where('video_provider_name = ?', $providerName)
->where('video_uploaded = 0')
->where('video_brand_id = ?', $countryBrandId);
return $select->query()->fetchAll();
}
@Osukaru
Copy link
Author

Osukaru commented Oct 3, 2012

public function fetchByCountryBrand($countryBrandId, $providerName = 'mpx')
{
    $select = $this->select()
        ->setIntegrityCheck(false)
        ->from(array('v' => $this->_name))
        ->joinLeft(
           array('a' => 'album'),
           'album_id = video_album_id'
        )
        ->joinLeft(
           array('s' => 'serie'),
           'serie_id = album_serie_id'
        )
    ->where('video_status = 1')
    ->where('video_provider_name = ?', $providerName)
    ->where('video_uploaded = 0')
    ->where('video_brand_id = ?', $countryBrandId);

    return $select->query()->fetchAll();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment