loadAllWhere( 'objectPHID = %s', $object->getPHID()); foreach ($attachments as $attachment) { $attachment->delete(); } } }