Version 5.0.0 beta 10
This commit is contained in:
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' );
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user