Questions tagged [object-property]

68 questions
3003
votes
48 answers

Detecting an undefined object property

What's the best way of checking if an object property in JavaScript is undefined?
Matt Sheppard
  • 111,039
  • 46
  • 105
  • 128
41
votes
1 answer

Javascript: Checking if an object has no properties or if a map/associative-array is empty

Possible Duplicate: How do I test for an empty Javascript object from JSON? Is there an easy way to check if an object has no properties, in Javascript? Or in other words, an easy way to check if a map/associative array is empty? For example,…
Vivin Paliath
  • 87,975
  • 37
  • 202
  • 284
5
votes
1 answer

Is it possible to make a property which listen to changes of custom objects in javafx?

Let's assume I have an entity class Foo which contains some fields, getters, setters and constructor. For example: public class Foo { private Integer a = 0; private Integer b = 0; public Foo() { } public Integer getA() { return a; } public…
4
votes
2 answers

Attempt to assign property of non-object - Laravel 5.2

Issue: Converting my Laravel 4 code to Laravel 5.2. I'm at the point of moving and converting my views and cannot get past the following error. Error: ErrorException in IndexController.php line 27: Attempt to assign property of non-object Debug…
scrfix
  • 1,088
  • 3
  • 9
  • 22
3
votes
0 answers

Inconsistency with bracket notation in object property accessors for dynamically named constructor-function. Is there an explanation?

I want to dynamically create objects of dynamically named class (sorry JS, I got used to call them classes) via dynamically named anonymous function. In this answer I found out that... As of ES2015, the function created by an anonymous function…
3
votes
1 answer

OWL Same Object Property for different Classes

I am trying to convert a UML Class Diagram into an Ontoloy and I have a Question. Let's say I have the following setup: rel1 ClassA ------> ClassB rel1 ClassC ------> ClassD For the first case I converted the Relation "rel1" to an…
John
  • 53
  • 4
3
votes
2 answers

How To Dynamically Access Object Property?

I have stored name of a property of an object as a string. In PHP, if the object were named $object and the property variable was named $key, it could be accessed with $object->$key. How can I dynamically access properties in ActionScript?
Mr Coder
  • 7,961
  • 5
  • 39
  • 73
3
votes
1 answer

Laravel Relationship working, but showing it -> Trying to get property of non object

In my Controller I have: public function showMainPage() { $categories = Category::with('subcategories.products.prices', 'subcategories.products.image')->get(); $data = array( "categories" => $categories, ); …
Scarwolf
  • 1,397
  • 2
  • 12
  • 41
3
votes
1 answer

OWL Object Property domain/range restrictions to the same level classes

I want to design an object property which is always linked only between the same level of classes. For example, I want to limit the property isCounterPartOf to be an arc of the sibling nodes which belong to the same upper class, such as house…
MJ Park
  • 303
  • 1
  • 10
3
votes
0 answers

ng-table fields that are object property

I want a column in ng-table-dynamic that has a field which is an object property. { field: 'customer.name', title: "Customer Name", show: true } I tried lot of different way…
praveensanap
  • 103
  • 8
3
votes
1 answer

Protege: Object property restrictions 1

I'm using Protege 4.3 to create my first ontology, so I encountered a few problems Let's say we have the classes Shop, Mall, and Person and the properties works-inand is-part-of. So the first problem is we want: if a Person works-in Shop and Shop…
DS_UNI
  • 2,413
  • 2
  • 9
  • 19
2
votes
1 answer

Exclude individuals that is related by some specific inverse properties

I have some individuals A,B,C,D,E, and two properties P1, P2. A P1 B C P1 D E P2 C I want to build a Class that only captures A but not C. so I set a Class like, myClass EquivalentTo: (P1 some owl:Thing) and (P1 only owl:Thing) myClass…
MJ Park
  • 303
  • 1
  • 10
2
votes
1 answer

OWL: How to get inheritance of property relations between two classes from those of superclasses?

Let's say we have two classes named People and Disease. These classes are related by the Object Property has. :People :has :Disease People has subclass (or individual) John, and Disease has subclass (or individual) Cancer. :John a :People :Cancer…
MJ Park
  • 303
  • 1
  • 10
2
votes
2 answers

If I Iterate Over an Objects Properties using JQuery $.each() is there an index?

a = {b:'bb',c:'cc',d:'dd'}; $.each(a, function(index){ // here 'index' is a string variable containing the property name, ie 'b', 'c' or 'd'. } I want the integer index of the property - is this possible without using an independent count…
user1561108
  • 2,497
  • 5
  • 38
  • 61
2
votes
1 answer

List object properties from a instance in Jena

How can I list all Object Properties associated to a instance in Jena? For example: A Person has an Object Property called "hasVehicle" which is associated with a class Vehicle
Leandro
  • 33
  • 1
  • 4
1
2 3 4 5