fix
This commit is contained in:
@@ -40,13 +40,12 @@ class NullTable extends ADataManager
|
||||
'title' => 'Id',
|
||||
]),
|
||||
'CREATED_AT' => new \Bitrix\Main\Entity\DatetimeField('CREATED_AT', [
|
||||
'default_value' => new \Bitrix\Main\Type\DateTime(),
|
||||
'title' => 'CreatedAt',
|
||||
'in_form' => false,
|
||||
'user_edit' => false,
|
||||
]),
|
||||
'UPDATED_AT' => new \Bitrix\Main\Entity\DatetimeField('UPDATED_AT', [
|
||||
'title' => 'UpdatedAt',
|
||||
'in_form' => false,
|
||||
'user_edit' => false,
|
||||
]),
|
||||
);
|
||||
}
|
||||
@@ -58,7 +57,7 @@ class NullTable extends ADataManager
|
||||
* @return \Bitrix\Main\ORM\Data\UpdateResult
|
||||
* @throws \Bitrix\Main\ObjectException
|
||||
*/
|
||||
public static function update($id, $fields)
|
||||
public static function update($id, array $fields)
|
||||
{
|
||||
foreach (static::getEntity()->getFields() as $field){
|
||||
if(is_a($field, DatetimeField::class)){
|
||||
@@ -71,6 +70,7 @@ class NullTable extends ADataManager
|
||||
$fields = array_merge($fields, [
|
||||
'UPDATED_AT' => new \Bitrix\Main\Type\DateTime(), // date(CDatabase::DateFormatToPHP(FORMAT_DATETIME))
|
||||
]);
|
||||
unset($fields['CREATED_AT']);
|
||||
|
||||
$result = parent::update($id, $fields);
|
||||
return $result;
|
||||
@@ -81,7 +81,7 @@ class NullTable extends ADataManager
|
||||
* @return \Bitrix\Main\ORM\Data\AddResult
|
||||
* @throws \Bitrix\Main\ObjectException
|
||||
*/
|
||||
public static function add($fields)
|
||||
public static function add(array $fields)
|
||||
{
|
||||
$fields = array_merge($fields, [
|
||||
'CREATED_AT' => new \Bitrix\Main\Type\DateTime(),
|
||||
|
||||
Reference in New Issue
Block a user