Skip to content

Add database field attributes for entries#4444

Merged
Alkarex merged 4 commits intoFreshRSS:edgefrom
Alkarex:entry_attributes
Jul 19, 2022
Merged

Add database field attributes for entries#4444
Alkarex merged 4 commits intoFreshRSS:edgefrom
Alkarex:entry_attributes

Conversation

@Alkarex
Copy link
Copy Markdown
Member

@Alkarex Alkarex commented Jul 12, 2022

Just like we already have for categories, feeds, etc.
No core use yet, but allows in particular extensions to save per-entry data

Example of extension code:

<?php
class TestAttributesExtension extends Minz_Extension {
	public function init() {
		$this->registerHook('entry_before_insert', [ 'TestAttributesExtension', 'setAttributes' ]);
	}

	public static function setAttributes(FreshRSS_Entry $entry): FreshRSS_Entry {
		$entry->_attributes('my-extension-data', 'blabla');
		return $entry;
	}
}

Just like we already have for categories, feeds, etc.
No core use yet, but allows in particular extensions to save per-entry data
@Alkarex Alkarex added this to the 1.20.0 milestone Jul 12, 2022
@Alkarex Alkarex merged commit 0866fda into FreshRSS:edge Jul 19, 2022
@Alkarex Alkarex deleted the entry_attributes branch July 19, 2022 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant