Questions tagged [dynamic-properties]
75 questions
9
votes
3 answers
Is it possible to add methods on the fly to MATLAB classes?
Writing a subclass of dynamicprops allows to me to add properties dynamically to an object:
addprop(obj, 'new_prop')
This is great, but I would also love to create set / get functions for these properties on the fly. Or analysis functions that work…

memyself
- 11,907
- 14
- 61
- 102
6
votes
2 answers
Laravel dynamic property not working
I'm using the eloquent ORM in Laravel with a hasMany relationship.
when I run:
Level::find(1)->lessons()->get();
It works fine, but when I use the dynamic property like so:
Level::find(1)->lessons
It just returns results for the level instead of…

Rob
- 10,851
- 21
- 69
- 109
5
votes
2 answers
Dynamically assign the getter for a dependent property in MATLAB
In Matlab, I can define a class as such:
classdef klass < handle
properties(Dependent)
prop
end
end
Matlab is perfectly happy instantiating an object of this class, even without defining a getter for prop. It only fails when I try…

mbauman
- 30,958
- 4
- 88
- 123
4
votes
3 answers
Objective C - respondsToSelector for dynamic properties
I am currently facing the problem to check whether a property of an Object (NSManagedObject) exists or not.
Unfortunately the method
[[MyObject class] respondsToSelector:@selector(myProperty)];
always returns NO.
I think it's because the property…

Alexander
- 7,178
- 8
- 45
- 75
4
votes
2 answers
PHP:isset() returns false for object's dynamic properties
I have a heirarchy of classes that get initialized from a database. I am using __get() and __set() with an array in a common Item base class to support different numbers of properties. One class derived from Item, UserProfile is used to store user…

Sinthia V
- 2,103
- 2
- 18
- 36
4
votes
2 answers
How would I convert List> into a List<[new class with dynamic properties]>
I have a design where class holds a List<> of Summary objects, and each Summary is a dictionary of semi-dynamic properties. That is, every Summary in a given list will have the same keys in the dictionary. I'm using this design to build a set of…

Daniel Jones
- 117
- 1
- 7
3
votes
1 answer
Multiple instances of a bean of one class filled with values from application.properties
I intend to write some HealtCheckContributors for a Spring Boot application using spring-boot-actuator. Hence, I implemented two of them. they are intended for checking the health of different apps, of course, but have a nearly identical structure,…

du-it
- 2,561
- 8
- 42
- 80
3
votes
1 answer
@dynamic properties not supported in GDB?
I'm using @dynamic properties in combination with -forwardInvocation: to generate properties at runtime (like described in this answer). Now, when I try to work with such a property (assuming name is such a dynamic property) in GDB I always get…

Ortwin Gentz
- 52,648
- 24
- 135
- 213
3
votes
1 answer
Is there a way to create a dynamic model that has dynamic rules to validate dynamic properties using Yii2?
I have a bunch of dynamic forms which means I can't know beforehand what and how many input fields a form has and how many forms it will be. I would like to create a dynamic model that has dynamic rules for validating all kinds of input fields and…

O Connor
- 4,236
- 15
- 50
- 91
3
votes
1 answer
boost::dynamic_properties and immutable graph object
after implementing some algorithm using the BGL, im trying to provide io functions using GraphML. However, i dont manage to compile a suitable operator<< that takes a const Graph reference.
Here is a boiled down example:
// use bundled properties…

Marti Nito
- 697
- 5
- 17
2
votes
2 answers
C# - Dynamic properties and RaisePropertyChanged
I have following class which I use for radio button binding
public class RadioButtonSwitch : ViewModelBase
{
IDictionary _options;
public RadioButtonSwitch(IDictionary options)
{
…

Luke
- 1,872
- 20
- 31
2
votes
0 answers
Why does Matlab change the value of all objects that are properties of a main object?
I am having trouble understanding the behaviour of Matlab when it comes to changing the properties of objects that are set as a property of some other object. Specifically, suppose I have three objects: a parentObject, a childObject and a…

Sam
- 305
- 1
- 8
2
votes
1 answer
Spring reload properties without restarting TOMCAT
I have this Spring MVC application that makes use of PropertyPlaceholderConfigurer to load properties using @Value annotation.
I understand that all properties are loaded at server startup when context is initialized.
Howevver, is there a way that…

va1b4av
- 431
- 9
- 26
2
votes
1 answer
Custom/Dynamic properties on objects/structs
Is it possible in Swift to create a struct that has "dynamic" properties?
i.e. if I have a dictionary that is returned from some JSON API and I know at build time that it has name, id in it.
Then I can build a struct like...
struct MyStruct {
…

Fogmeister
- 76,236
- 42
- 207
- 306
2
votes
1 answer
Boost: access graph specific properties with read_graphml()
I am trying to read graph related (custom) properties from a .graphml file created with yEd using the Boost Graph library. Reading vertex and edge (dynamic_)properties works but my graph properties are always empty. I've also came across how to read…

CodeFinder
- 21
- 1
- 2