/**
  * Creates an attachment by a given database identifier
  * 
  * @param $db [ref] the database connection
  * @param $id the database identifier of the attachment
  * @param $detailLevel the detailLevel
  * @return tlAttachment the created attachment or null on failure
  */
 public static function getByID(&$db, $id, $detailLevel = self::TLOBJ_O_GET_DETAIL_FULL)
 {
     return tlDBObject::createObjectFromDB($db, $id, __CLASS__, tlAttachment::TLOBJ_O_SEARCH_BY_ID, $detailLevel);
 }
Exemple #2
0
 public static function getByIDs(&$db, $ids, $detailLevel = self::TLOBJ_O_GET_DETAIL_FULL)
 {
     $users = null;
     for ($i = 0; $i < sizeof($ids); $i++) {
         $id = $ids[$i];
         $user = tlDBObject::createObjectFromDB($db, $id, __CLASS__, self::TLOBJ_O_SEARCH_BY_ID, $detailLevel);
         if ($user) {
             $users[$id] = $user;
         }
     }
     return $users ? $users : null;
 }