/** * Finds a list corresponding to a few params * * @param CMbObject $object The host object * @param string $date The date * @param string $type The type of list * @param int $list_type_id List type ID * @param boolean $load_list If true, load references for list * * @return self|self[] */ static function getList(CMbObject $object, $date = null, $type = null, $list_type_id = null, $with_refs = true) { $list = new self(); $list->object_class = $object->_class; $list->object_id = $object->_id; $list->list_type_id = $list_type_id; $list->date = $date; $list->type = $type; $list->loadMatchingObject(); $list->_ref_object = $object; if ($with_refs) { $list->loadRefListType()->loadRefsCategories(); } $list->isReadonly(); return $list; }