Exemplo n.º 1
0
 public static function tagInstancesForModel($sModelName, $iTaggedItemId)
 {
     $oCriteria = new Criteria();
     $oCriteria->add(TagInstancePeer::TAGGED_ITEM_ID, $iTaggedItemId);
     $oCriteria->add(TagInstancePeer::MODEL_NAME, $sModelName);
     return TagInstancePeer::doSelect($oCriteria);
 }
Exemplo n.º 2
0
 /**
  * Retrieve object using using composite pkey values.
  * @param   int $tag_id
  * @param   int $tagged_item_id
  * @param   string $model_name
  * @param      PropelPDO $con
  * @return TagInstance
  */
 public static function retrieveByPK($tag_id, $tagged_item_id, $model_name, PropelPDO $con = null)
 {
     $_instancePoolKey = serialize(array((string) $tag_id, (string) $tagged_item_id, (string) $model_name));
     if (null !== ($obj = TagInstancePeer::getInstanceFromPool($_instancePoolKey))) {
         return $obj;
     }
     if ($con === null) {
         $con = Propel::getConnection(TagInstancePeer::DATABASE_NAME, Propel::CONNECTION_READ);
     }
     $criteria = new Criteria(TagInstancePeer::DATABASE_NAME);
     $criteria->add(TagInstancePeer::TAG_ID, $tag_id);
     $criteria->add(TagInstancePeer::TAGGED_ITEM_ID, $tagged_item_id);
     $criteria->add(TagInstancePeer::MODEL_NAME, $model_name);
     $v = TagInstancePeer::doSelect($criteria, $con);
     return !empty($v) ? $v[0] : null;
 }