//isUsedByADownloadsCategory() ) { unset( $buttons['delete']['data'] ); } return $buttons; } /** * Is this Forum used by any downloads app category ? * * @return bool|\IPS\downloads\Category */ public function isUsedByADownloadsCategory() { foreach( new \IPS\Patterns\ActiveRecordIterator( \IPS\Db::i()->select( '*', 'downloads_categories' ), 'IPS\downloads\Category' ) AS $category ) { if ( $category->forum_id and $category->forum_id == $this->id ) { return $category; } } return FALSE; } }