public static function LPModuleAvailability::createWithValues in Opigno Learning path 8
Same name and namespace in other branches
- 3.x src/Entity/LPModuleAvailability.php \Drupal\opigno_learning_path\Entity\LPModuleAvailability::createWithValues()
Creates a new LPModuleAvailability object with the values passed in param.
It's not saved automatically. You need to do $obj->save().
Return value
\Drupal\Core\Entity\EntityInterface|self LPModuleAvailability object.
File
- src/
Entity/ LPModuleAvailability.php, line 37
Class
- LPModuleAvailability
- The Learning Path Module Availability entity type definition.
Namespace
Drupal\opigno_learning_path\EntityCode
public static function createWithValues($group_id, $entity_id, $availability = 0, $open_date = 0, $close_date = 0) {
$values = [
'group_id' => $group_id,
'entity_id' => $entity_id,
'availability' => $availability,
'open_date' => $open_date,
'close_date' => $close_date,
];
return parent::create($values);
}