Skip to main content

Questions tagged [getter]

A getter is a public accessor method, used in object-oriented programming, which returns the value associated with a private member of a class.

getter
0 votes
0 answers
19 views

sequelize getter in HasMany error TypeError: is not a function

I want to make a getter beetween two table. In the controler of one who get in the other, the getter is not a function. The model Comitee who as many club export class Comitee extends Model<...
Huyenlong's user avatar
1 vote
2 answers
96 views

How to write a getter which accesses a heap-allocated member variable

Lets say I have the member: char* name; When writing a getter function to this member, is this the correct way: char* getName(){ return name; } But when we do this, now user of this class can ...
serkan ertas's user avatar
0 votes
0 answers
62 views

How to use Classes and their getters in Pinia store?

I have defined a Pinia store in which my user's character is made, stored/retrieved from localStorage, and pushed into an array which the store eventually returns. This is done by defining the class ...
VHK's user avatar
  • 101
0 votes
3 answers
117 views

What is the difference between get and function in an Object (Javascript)?

I have hard time understanding why there are two different ways to perform an absolutely identical operation in JavaScript objects. Here I've got an object which contains an array in its "log&...
VantaBlack's user avatar
0 votes
1 answer
93 views

Getters for multidimensional arrays

I was wondering how to exactly do a getter for a multidimensional array. I have a class (called Figure), one of its attributes is a bidimenisonal array (matrix), and I want to read that matrix from ...
Ambake's user avatar
  • 1
0 votes
2 answers
169 views

Does FilamentPHP execute Models accessors when editing or viewing a row?

I have a critical concern, which might have a dumb & simple solution I cannot find, or it might open a Pandora box. If you define an accessor in a model, and then you try to use it in a ...
Internetbug256's user avatar
0 votes
0 answers
31 views

javascript export variable or getter but returning value?

So I'm working with some export in js and do not understand the way they interact... I have those two files : imported file export var a = 0; // getter on a export function A() { return a; } // ...
Ren's user avatar
  • 155
-1 votes
3 answers
74 views

Getter returns undefined in if statement. Seems not working for comparisons

I have a ClockObj which has an AlarmObj in a "HAS A" OOP relationship. Or should I say injected through the constructor. Inside the AlarmObj I have a isAlarmOn boolean variable. I am ...
ILIIA CHTEREV's user avatar
0 votes
1 answer
44 views

why am I getting an error on calling clothing.getLastWornDate() method? [closed]

I am working on a Java assignment for school. In this method, I am trying to save to a file as described by assignment, but I am getting an error when calling clothing.getLastWornDate() and am lost as ...
Wremmurg's user avatar
0 votes
0 answers
54 views

Angular async pipe loading page forever when using getter in component

I have created standalone component. import { AsyncPipe, CommonModule } from '@angular/common'; import { Component, OnInit } from '@angular/core'; import { FormsModule } from '@angular/forms'; @...
Visrut's user avatar
  • 549
0 votes
1 answer
66 views

LWC setter is not getting called

LWC setter is not getting called. <template> {message}<br><br>1. getter value: {displayMessage}<br><br>2. setter value: {updatedMessage} </template> import { ...
Salesforce developer's user avatar
0 votes
2 answers
172 views

Get the default value of a property of an abstract class

Is there a way in C# to access the default value of a non-static, non-const property that is defined in an abstract class? For example, given: public abstract class SomeClass { public int ...
alelom's user avatar
  • 2,690
0 votes
1 answer
126 views

How to subclass Array in JavaScript and override 'length' getter and setter?

I am trying to subclass JavaScript array and override 'length' getter and setter. This code is not working - it outputs nothing to the console because getter and setter are not called. How to fix this?...
dvv's user avatar
  • 731
-2 votes
1 answer
59 views

getter method does wait for a previous async call to complete

I have this in my JS file : let xe = 0; const get_usd2inr = async () => { return await fetch(BASE_URL + "api/usd") .then(response => response.json()) .then(response => ...
anjanesh's user avatar
  • 4,127
0 votes
1 answer
47 views

How to dynamically set a getter for an Objective-C object property?

FooClass has a property called foo. It's declared as @property (nullable, nonatomic, readonly, strong) id foo and it has NO underlying storage, it's not synthesized. It's just a getter that by default ...
Isaaс Weisberg's user avatar

15 30 50 per page
1
2 3 4 5
127