mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-24 22:11:01 -06:00
optional configuration ad name
This commit is contained in:
parent
c3b005f48c
commit
dfa4e06daa
@ -4,5 +4,5 @@ use Anomaly\Streams\Platform\Entry\Contract\EntryInterface;
|
|||||||
|
|
||||||
interface OptionConfigurationInterface extends EntryInterface
|
interface OptionConfigurationInterface extends EntryInterface
|
||||||
{
|
{
|
||||||
public function getName();
|
public function getName($add_name = true);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,10 +13,10 @@ class OptionConfigurationModel extends AdvsOptionConfigurationEntryModel impleme
|
|||||||
|
|
||||||
public function getOptionNameAttribute()
|
public function getOptionNameAttribute()
|
||||||
{
|
{
|
||||||
return $this->getName();
|
return $this->getName(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getName()
|
public function getName($add_name = true)
|
||||||
{
|
{
|
||||||
if ($adv = app(AdvRepositoryInterface::class)->find($this->parent_adv_id)) {
|
if ($adv = app(AdvRepositoryInterface::class)->find($this->parent_adv_id)) {
|
||||||
$configurations_item = json_decode($this->option_json, true);
|
$configurations_item = json_decode($this->option_json, true);
|
||||||
@ -27,7 +27,9 @@ class OptionConfigurationModel extends AdvsOptionConfigurationEntryModel impleme
|
|||||||
$option_group_value .= " " . $value_entry->getName();
|
$option_group_value .= " " . $value_entry->getName();
|
||||||
}
|
}
|
||||||
|
|
||||||
return $adv->name . ' | ' . trim($option_group_value, ' ');
|
$name = trim($option_group_value, ' ');
|
||||||
|
|
||||||
|
return ($add_name) ? $adv->name . ' | ' . $name : $name;
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user