/** * Update Role Views and User Views for each custom field * Designed to be externally called (e.g. from LfMerge) * * @param string $projectCode * @param array<string> $customFieldSpecs * @return bool|string returns the project id on success, false otherwise */ public static function updateCustomFieldViews($projectCode, $customFieldSpecs) { $project = new LexProjectModel(); if (!$project->readByProperty('projectCode', $projectCode)) { return false; } self::removeDeletedCustomFieldViews($customFieldSpecs, $project->config); foreach ($customFieldSpecs as $customFieldSpec) { self::createNewCustomFieldViews($customFieldSpec['fieldName'], $customFieldSpec['fieldType'], $project->config); } return $project->write(); }
/** * @param $identifier * @return string|bool $projectId if send receive project is linked to a LF project, false otherwise */ public static function getProjectIdFromSendReceive($identifier) { $project = new LexProjectModel(); if (!$project->readByProperty('sendReceiveProjectIdentifier', $identifier)) { return false; } return $project->id->asString(); }