bartle
  • Login
  • Public

    • Public
    • Network
    • Groups
    • Popular
    • People

Conversation

Notices

  1. Michael Vogel (heluecht@pirati.ca)'s status on Monday, 26-Dec-2022 22:59:48 CET Michael Vogel Michael Vogel
    • Friendica Developers
    I've got a question where to place the functions to return data for the reports and to set the status. There is the report "factory" and the report "repository". At least I guess that the functions wouldn't be placed in this report "entity".

    Concerning constants: I guess that they are placed in the "entity" class, aren't they?
    In conversation Monday, 26-Dec-2022 22:59:48 CET from pirati.ca permalink
    • hypolite (hypolite@friendica.mrpetovan.com)'s status on Monday, 26-Dec-2022 22:59:48 CET hypolite hypolite
      in reply to
      @heluecht Entity-related constants are placed in the Entity. What kind of return data are we talking about? To update the status of a report, it would be in the Entity.
      In conversation Monday, 26-Dec-2022 22:59:48 CET permalink
    • Michael Vogel (heluecht@pirati.ca)'s status on Monday, 26-Dec-2022 22:59:48 CET Michael Vogel Michael Vogel
      in reply to
      • hypolite
      @hypolite I thought that the "entity" only contains the class variables?

      What I want to do is to create constants for the status. So they are "entity-related", I guess.

      Also I want to create functions like "setDismissed" (and similar) to update the status. Also some "getOpenReports" that should return an array of reports. Concerning the returned data, I also want to return an enhanced set of data. Means: I don't only want to return the contact id of the reported contact and the uri-id of the posts, but also all needed contact related data (nick, name, url, avatar, ...) and the post related data (like title, body, creation date, ...). For this I want to create some view that then has to be called inside of that class.
      In conversation Monday, 26-Dec-2022 22:59:48 CET permalink
    • Michael Vogel (heluecht@pirati.ca)'s status on Monday, 26-Dec-2022 23:20:51 CET Michael Vogel Michael Vogel
      in reply to
      • hypolite
      @hypolite I don't understand why we should split the setting of the status in two steps? Why not directly set and store the status? I don't see any sense in storing (and overwriting) all the existing fields when we only want to change some little status field.

      Concerning "createFromTableRow": I don't want to return just the array of the uri-ids there, but some array with enhanced data per record. So I guess that function needs some enhancement.
      In conversation Monday, 26-Dec-2022 23:20:51 CET permalink
    • hypolite (hypolite@friendica.mrpetovan.com)'s status on Monday, 26-Dec-2022 23:20:52 CET hypolite hypolite
      in reply to
      @heluecht The status values are Entity constants, the dismiss() is an Entity method (don't forget to call Repository->save() after!). I want to avoid get* and set* methods in the Entity classes. Just create methods for the use-cases we have. Do we dismiss reports? dismiss(). Do we reopen them if they were dismissed? reopen().

      Querying a list of reports based on conditions is in the Repository since it's interacting with the database. You can create a joined query, then use Factory->createFromTableRow to obtain Report entities, and you can use the rest of the row fields for what you want.
      In conversation Monday, 26-Dec-2022 23:20:52 CET permalink

Feeds

  • Activity Streams
  • RSS 2.0
  • Atom
  • Help
  • About
  • FAQ
  • Privacy
  • Source
  • Version
  • Contact

bartle is a social network. It runs on GNU social, version 2.0.1-beta0, available under the GNU Affero General Public License.

Creative Commons Attribution 3.0 All bartle content and data are available under the Creative Commons Attribution 3.0 license.