コード例 #1
0
ファイル: dbobject.php プロジェクト: nemein/openpsa
 /**
  * Returns a complete list of attachments for the current object. If there are no
  * attachments, an empty array is returned.
  *
  * @param midcom_core_dbaobject $object The DBA object we're working on
  * @return Array A list of midcom_db_attachment objects or false on failure.
  */
 public static function list_attachments(midcom_core_dbaobject $object)
 {
     if (!$object->id) {
         debug_add('Cannot retrieve attachments on a non-persistant object.', MIDCOM_LOG_WARN);
         return array();
     }
     $qb = $object->get_attachment_qb();
     $result = $qb->execute();
     if (!$result || !is_array($result)) {
         return array();
     }
     return $result;
 }