1,894
questions
0
votes
0
answers
19
views
Why my Getter and Setter doesnt work as i expected [duplicate]
I am trying to get value if they are uppercase it will say its loud else it will show the value.
class cat {
constructor(say){
this.say = say;
}
get scream(){
return ...
0
votes
1
answer
29
views
Why direct access of data fetched from db using doctrine does not work while using getter do work?
In PHP Symfony project with doctrine, I am using following class with self-referencing attribute "credit" and another attribute referencing class foo as follow.
/**
* Bill
*
* @ORM\Table(...
0
votes
0
answers
22
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<...
1
vote
2
answers
100
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 ...
0
votes
0
answers
88
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 ...
0
votes
3
answers
192
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&...
0
votes
1
answer
97
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 ...
1
vote
2
answers
273
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 ...
0
votes
0
answers
32
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;
}
// ...
-1
votes
3
answers
82
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 ...
0
votes
1
answer
46
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 ...
0
votes
0
answers
63
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';
@...
0
votes
1
answer
104
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 { ...
0
votes
2
answers
235
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 ...
0
votes
1
answer
141
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?...
-2
votes
1
answer
74
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 =>
...
0
votes
1
answer
48
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 ...
1
vote
0
answers
62
views
Is it possible to assign return value for getter without private backing field C# [duplicate]
I come across the following example:
public class TimeService
{
public TimeService()
{
Time = DateTime.Now.ToLongTimeString();
}
public string Time { get; }
}
We have ...
0
votes
2
answers
31
views
Quizzler getter requires positional argument
I am doing "The Complete Flutter Development Bootcamp with Dart", and when I am getting the error below:
lib/main.dart:47:42: Error: Too few positional arguments: 1 required, 0 given.
...
0
votes
1
answer
45
views
I'm having trouble using a getter method for an object that has been initialized, but is not in the same class as the getter method
I'm writing a text based game for my computer science class (I'm a beginner and still learning new stuff pretty much everyday) and I'm trying to make a method that will print out the information of ...
1
vote
1
answer
301
views
Pinia getter undefined if used with filter
I have a Pinia store:
import { defineStore } from "pinia";
import { api } from "@/services/api";
export const useMaterialStore = defineStore("material", {
state: () =&...
0
votes
0
answers
44
views
python getter and setter properties
I am new to properties in Python and a bit confused on how below code is working
class FavoriteShape:
def __init__(self, color, shape):
self.color = color
self.shape = shape
@...
0
votes
0
answers
16
views
vue3 app problem to invoke getter from view components
I am trying to invoke from my component view (HomeView) the getter related to the module home (from store) in the way to access the state's variable. Here the files:
//index.js
import { createStore } ...
0
votes
1
answer
104
views
DWScript: Property getter/setter for object
The tdwsUnit declares a property of type TObject, as well as a getter and a setter. An instantiated object shall be stored in an "object store" on the Delphi side. The goal is to transport ...
0
votes
1
answer
264
views
How to importing library that define "favorites" at Flutter
i am very beginner ..and just start learning flutter. I follow "Your First Flutter App" from Google Codelabs, and stop at this step: https://codelabs.developers.google.com/codelabs/flutter-...
0
votes
1
answer
71
views
Const-correctness with getters of vector of non-pointers [duplicate]
I have a quick question regarding const-correctness for getters of vector of non-pointers.
Basically, I have this class with a non-const getter and a const getter for m_Vertices:
class Mesh
{
public:
...
0
votes
0
answers
61
views
IntelliJ seems to not recognize my getter methods
I'm trying to display data from a database in a TableView in JavaFx, and I'm using the class CheckAssunzione for creating my assunzione object that will be used to populate the table. I also have a ...
0
votes
1
answer
31
views
Vuex (Vue3) unable to transmit payload
I have removed the methods that are not involved in the case for a more concise display.
Need to return the count value for the object with the specified id. When I pass a valid id to counter, the ...
3
votes
2
answers
137
views
ValueType as property in class
I am a bit confused with a concept of value types as properties in a class.
As far as I understand, when getter is called - a copy of value type is returned.
Let's have an example:
public struct Point
...
0
votes
2
answers
152
views
How to compute a getter in vue?
I'm expecting to display a computed getter property, but VSC gives me the error "Expected to return a value in 'features' computed property." Even though I'm returnng a true value in getter ...
0
votes
1
answer
19
views
What is the "type" of an ES6 class getter in Typescript?
I have a class that looks like this:
export class WidgetsManager {
private foo?: boolean;
private bar?: boolean;
// ... and so on
constructor(config: Config | null) {
this.foo = config....
2
votes
2
answers
6k
views
The getter 'params' isn't defined for the type "GoRouterState" Flutter
I am trying to resolve the issue with getter, error message:
The getter 'params' isn't defined for the type 'GoRouterState'.
Try importing the library that defines 'params', correcting the name to ...
0
votes
0
answers
108
views
Why does the entity's getter get called twice?
I use Spring Boot with Hibernate. I have an entity containing some credentials:
@Entity
class MyEntity {
@Column(name = "credentials", columnDefinition = "jsonb")
@Type(...
1
vote
1
answer
263
views
Ember Octane, Tracked property not recomputing get function using the property
In emberJS Octane, I expect a "get" function to be recomputed when the used tracked properties inside of it changes. It does not in my case.
Here is my template :
{{#each this.model....
0
votes
1
answer
64
views
How to pass an input event to the getter store Vuex?
How to pass an input field to the getter?
I'm trying to pass th einput field to the getter as a paramether. How to pass the param to the getter ?
<input
type="text"
...
-1
votes
1
answer
208
views
Converting a Javascript Object to Lua table
I have a Javascript object where one of the keys is a getter and I want to convert the entire object to a Lua table in order to use it in a wiki module.
So far I have managed to find how to convert ...
0
votes
1
answer
161
views
How can I pass back a function/method variable?
If I want to create a getter accessor for a method variable, the getter does not give back the variable, but it executes the code referenced by the variable.
unit Unit5;
interface
uses
Winapi....
1
vote
1
answer
78
views
What is the difference between a function and getter in Dart?
To get a value from a function I can to this:
bool goOutside() {
if(today is a good day){
return true;
}else{
return false;
}
}
But I can also do this:
bool get goOutside {
...
1
vote
0
answers
31
views
Python property getters and setters not working [duplicate]
I am attempting to use property-based getters and setters in Python and am getting strange problems. Consider the following code:#!/usr/bin/env python
class anyThing(object):
def __init__(self):
...
2
votes
1
answer
390
views
Config.GetSection<T> with invalid class property names
Using IConfigurationRoot extension method
public static T GetSectionAsObject<T>(this IConfigurationRoot configuration, string key)
{
return configuration.GetSection(key).Get<T>();
}
I ...
-1
votes
2
answers
78
views
Why doesn't return getter like in Java (C#)
I want to move from Java to C# and I want to try getter and setter like in Java
internal class Person
{
internal string name;
internal void setName (string name)
...
-2
votes
1
answer
41
views
How to access text value outside of initialization of Radiobutton
fruit_frame = LabelFrame(root, text = "Fruit", padx = 15, pady = 15) fruit_frame.grid(row = 0, column = 0)
veg_frame = LabelFrame(root, text = "Vegetables", padx = 15, pady = 15) ...
0
votes
0
answers
61
views
Getter returning incorrect value
I'm building an application for storing/searching/sorting cars and I'm running into an issue with one method.
I have six ArrayLists, storing variables of different data types:
Car c1 = new Car(1, &...
0
votes
1
answer
150
views
Swift Crash in getter for location services
I received several crashes in Xcode organizer, but I'm not able to find the root cause for it. Would be nice, if someone could look at it and give his thoughts ...
... here is the code of the getter
/...
0
votes
2
answers
332
views
c++ setter/getter does not work as expected
for some reason my prof insists I have to use setter/getter everywhere.
Well... in this linked list I don't understand why this one doesn't work
#include <iostream>
#include <string>
using ...
1
vote
0
answers
99
views
why my getter property is directly in my class instance?
I was testing a getter in my class and I faced a contrast in my implementation and document, based on MDN document a class getter property should be defined inside the instance's prototype
Getter ...
-2
votes
1
answer
125
views
Pinia : state change by It self [duplicate]
G'day,
I would like to have 3 elements :
Current Date (to display current month)
current date less 1 month (to display the month before)
current date plus 1 month (to display the next month)
I ...
0
votes
1
answer
188
views
How to use the non-const getter if there's a const one too?
If I have a class with getters of return type both const and non-const, how can I use the non-const one?
The class (MeshManipulator.h):
namespace vortex::meshSculptEngine
{
class MeshManipulator
...
0
votes
1
answer
117
views
getter setter can't change textBox.Text control value in Winform c#
Why textBox3.text do not shows value _TextBoxRequestMsg. MessageBox opens and shows _TextBoxRequestMsg value OK, console prints too.
public partial class F_Main : Form
{
private string ...
-2
votes
2
answers
72
views
How can I resolve "The argument type '
The getter 'message' isn't defined for the type 'Object'.
Try importing the library that defines 'message', correcting the name to the name of an existing getter, or defining a getter or field named '...