Version 5.0.0 beta 10

This commit is contained in:
Neo committed 2025-12-19 17:53:48 -08:00
1 parent 56979f8ee8
commit 264eeb97e0
325 files changed
+6442 -1849

No files matched your search

@@ -137,6 +137,29 @@ class Category extends Model
*/
public static bool $canBeExtended = true;
/**
* [ActiveRecord] Duplicate
*
* @return void
*/
public function __clone()
{
$oldId = $this->_id;
parent::__clone();
$attachmentsMap = [];
foreach( Db::i()->select( '*', 'core_attachments_map', [ 'location_key=? and id1=? and id3=?', 'blog_Categories', $oldId, 'bcategory' ] ) as $attachment )
{
$attachment['id1'] = $this->id;
$attachmentsMap[] = $attachment;
}
if( count( $attachmentsMap ) )
{
Db::i()->insert( 'core_attachments_map', $attachmentsMap );
}
}
/**
* [Node] Add/Edit Form
*
@@ -375,4 +398,16 @@ class Category extends Model
return new ActiveRecordIterator( Db::i()->select( '*', $contentItemClass::$databaseTable, $where, $contentItemClass::$databasePrefix . $contentItemClass::$databaseColumnId, $limit )->join( 'blog_blogs', "blog_entries.entry_blog_id=blog_blogs.blog_id" ), $contentItemClass );
}
}
/**
* Delete Record
*
* @return void
*/
public function delete(): void
{
parent::delete();
File::unclaimAttachments( 'blog_Categories', $this->id, null, 'bcategory' );
}
}