FilterList(function ($oItem) { return $oItem && $oItem->IsLinked(); }); } public function UnlinkedAttachments() : array { return $this->FilterList(function ($oItem) { return $oItem && !$oItem->IsLinked(); }); } public function SizeOfAttachments() : int { $iResult = 0; $this->ForeachList(function ($oItem) use (&$iResult) { if ($oItem) { $iResult += $oItem->FileSize(); } }); return $iResult; } }