Welcome Guest, Not a member yet? Register   Sign In
Search Results
    Thread: using services to create an ACL system
Post: RE: using services to create an ACL system

Great reply, thanks! I particularly value the direction that DB work belongs in a service in this case.  Could I impose to ask about how to init such a service at runtime? Since controller methods a...
2,002 Views
2 Replies
01-16-2025, 11:57 AM
evansharp
    Thread: using services to create an ACL system
Post: using services to create an ACL system

Hello! I am writing an app in which users can create a report object stored in a database. The access (view and edit) to these reports by the author and certain other users is dynamic and needs to be ...
2,002 Views
2 Replies
01-14-2025, 11:38 AM
evansharp
    Thread: How many models for many to many relations
Post: RE: How many models for many to many relations

MGatner Wrote: (02-21-2022, 11:18 AM) -- I prefer to use one, and then have my Entity use the related model to get its relations. This will be rough bc I am mobile but something like: PHP Code: -...
4,248 Views
3 Replies
10-22-2024, 07:36 AM
evansharp
    Thread: Behaviour of getInsertID() when using save()
Post: RE: Behaviour of getInsertID() when using save()

InsiteFX Wrote: (10-14-2024, 11:33 PM) -- getInsertId() is in system/BaseModel.php This is all that I can find on it. PHP Code: --     /**     * Returns last insert ID or 0.     *     * @re...
1,897 Views
3 Replies
10-20-2024, 10:32 AM
evansharp
    Thread: Behaviour of getInsertID() when using save()
Post: Behaviour of getInsertID() when using save()

When using the CI Model for basic CRUD, does `getInsertID()` return null when a preceding `save()` did an UPDATE rather than INSERT? Or does it return the affected primary key regardless? This detail ...
1,897 Views
3 Replies
10-14-2024, 06:08 PM
evansharp
    Thread: getting record id of upsert
Post: getting record id of upsert

Hello! When doing upserts, is there a tidy way of retrieving the primary key (e.g. id) of the affected record afterwards? I realize that logic is possible to use either a query or $db->insertID() af...
736 Views
0 Replies
09-20-2024, 01:24 PM
evansharp
    Thread: Accessing Shield User entity properties
Post: RE: Accessing Shield User entity properties

ozornick Wrote: (09-02-2024, 08:45 PM) -- User extend Entity? $atteibutes this is a protected property, it cannot be read outside the class. Try toArray() https://codeigniter4.github.io/userguide/m...
3,585 Views
5 Replies
09-06-2024, 04:21 PM
evansharp
    Thread: Accessing Shield User entity properties
Post: RE: Accessing Shield User entity properties

datamweb Wrote: (09-02-2024, 05:23 PM) -- You need to make sure they are logged in first. If a user is not logged in, `auth()->user()` will return `null`, and you won't be able to retrieve their deta...
3,585 Views
5 Replies
09-02-2024, 07:16 PM
evansharp
    Thread: Accessing Shield User entity properties
Post: Accessing Shield User entity properties

When I use the helper and reference  PHP Code: -- auth()->user()->attributes -- it's always NULL. If I dd() or var_dump() auth()->user() though, it shows $attributes is an array with juicy...
3,585 Views
5 Replies
09-01-2024, 10:23 PM
evansharp
    Thread: settings service: retrieve all properties of a class
Post: RE: settings service: retrieve all properties of a...

sammyskills Wrote: (10-11-2023, 11:57 PM) -- Hi @"evansharp" , Not sure I understand what you mean but, can't this be achieved using config() ? Like: PHP Code: -- config(App::class);  -- -...
3,165 Views
4 Replies
11-03-2023, 11:24 PM
evansharp
    Thread: settings service: retrieve all properties of a class
Post: settings service: retrieve all properties of a cla...

The docs don't mention (and I've been unable to hit upon) a way to retrieve all of the stored values for a whole class of properties. Is this a feature? Can I submit a request/ PR? The use-case is pr...
3,165 Views
4 Replies
10-10-2023, 10:34 PM
evansharp
    Thread: return value of settings helper call?
Post: RE: return value of settings helper call?

kenjis Wrote: (09-22-2023, 10:04 PM) -- Why do you want to get the result true/false? or why does it fail? If it fails to set, it is not recoverable, so it seems better an Exception is thrown. --...
4,825 Views
8 Replies
10-06-2023, 08:30 PM
evansharp
    Thread: return value of settings helper call?
Post: RE: return value of settings helper call?

kenjis Wrote: (09-22-2023, 08:50 PM) -- It is the return type of the setting() function. My previous post refers the Settings->set() or service('settings')->set() method -- returning void feels ...
4,825 Views
8 Replies
09-22-2023, 09:29 PM
evansharp
    Thread: return value of settings helper call?
Post: return value of settings helper call?

Hello, Where did the forum search capability go? I'm sure this has been asked before... When using the Settings helper, the github docs don't say if  `set()` returns a boolean on success/fail; which...
4,825 Views
8 Replies
09-21-2023, 07:15 PM
evansharp
    Thread: Where does a data-import map go?
Post: RE: Where does a data-import map go?

Just what I was looking for, thank you!
2,836 Views
2 Replies
02-21-2023, 01:19 PM
evansharp
    Thread: Where does a data-import map go?
Post: Where does a data-import map go?

Hello, I'm writing an application that will need to import a complex dataset in JSON format (via file upload) to a database. A human will have to perform a step of mapping JSON keys to DB fields beca...
2,836 Views
2 Replies
02-16-2023, 03:01 PM
evansharp
    Thread: Where is the Best Place for Cron Methods ?
Post: RE: Where is the Best Place for Cron Methods ?

You should follow a DRY (Don't Repeat Yourself) approach to these methods. If they're actions only performed by the cron job via you cron controller, then I'd say writing a private cron controller met...
7,313 Views
5 Replies
02-16-2023, 02:49 PM
evansharp
    Thread: how to get ID's after insertBatch()?
Post: RE: how to get ID's after insertBatch()?

This gets asked for a lot and to be honest, I've wished for it myself too. The issue is not just that 'CI does not provide this method', it's that the concept is flawed on the DB side. If another set ...
3,102 Views
2 Replies
04-30-2021, 08:50 AM
evansharp
    Thread: CI in apache userdirs (domain.com/~user/public/ci)
Post: RE: CI in apache userdirs (domain.com/~user/public...

John_Betong Wrote: (03-22-2021, 03:46 PM) -- My CI4 knowledge only stretches as far as simple web sites. I have no experience of having multiple users accessing the same web site. I've noticed yo...
23,982 Views
22 Replies
03-23-2021, 11:05 AM
evansharp
    Thread: CI in apache userdirs (domain.com/~user/public/ci)
Post: RE: CI in apache userdirs (domain.com/~user/public...

I did a level 6 trace on apache's rewrite for one request to the baseUrl. Everything looks correct and the passthrough path is what it should be for CI to work. So the duplication of the userdir u...
23,982 Views
22 Replies
03-22-2021, 01:36 PM
evansharp

Theme © iAndrew 2016 - Forum software by © MyBB