Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple function for basic data #39

Closed
TheKeymaster opened this issue Jan 26, 2018 · 0 comments
Closed

Simple function for basic data #39

TheKeymaster opened this issue Jan 26, 2018 · 0 comments

Comments

@TheKeymaster
Copy link

At the moment I need three lines in order to set a name without a usergroup:

$name = new Name();
$name->setValue($string);
$item->setName($name);

There should exist an easy way to handover the data to the exporter:

$item->setNameValueWithoutUsergroup($string);

Don't mind my function name there. I know it is bad.

Why should this be implemented?

This reduces the overhead immense when you want to really fill in much attributes, variations, properties etc. might even be >80 lines of code in one function, which is not needed. The function may still do the same internally, but is way easier to call.

Why not refactoring yourself?

Refactoring myself would be also very impracticable, because either a create a function for each XML element, or I create a function where I also need to add the class Name as a parameter in order to do such calls, which results in a complete fiesta.

howard added a commit that referenced this issue Jan 28, 2018
Fixes #39.

Simples values, i.e. values other than properties, attributes, images
and usergroups, can now be set using a `Item::add<value>($value,
$usergroup = '')` method.

The corresponding `Item::set<value>(...)` methods still exist, so
compatibility is retained. However, this change should increment the
minor version number because functionality is added.
howard added a commit that referenced this issue Jan 29, 2018
Simples values, i.e. values other than properties, attributes, images
and usergroups, can now be set using a `Item::add<value>($value,
$usergroup = '')` method.

The corresponding `Item::set<value>(...)` methods still exist, so
compatibility is retained. However, this change should increment the
minor version number because functionality is added.

Fixes #39.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants