KMP PHP API Reference

NotesCell extends Cell
in package

Notes cell

View Cell responsible for displaying and managing notes attached to various entities throughout the KMP application. Provides a reusable notes interface that can be embedded in any view to show entity-specific notes with proper permission handling.

The cell handles both public and private notes, with visibility controlled by user permissions. It provides functionality for displaying existing notes and creating new ones through an integrated form interface.

Key Features:

  • Entity-agnostic notes system (works with any entity type)
  • Public/private note visibility control
  • Author information display with notes
  • Integrated note creation form
  • Permission-based create/view controls
  • Chronological note ordering

Template: templates/cell/Notes/display.php

Tags
see
Note

Note entity definition

see
NotesTable

Notes table class

Table of Contents

Properties

$_validCellOptions  : array<string, mixed>
List of valid options that can be passed into this cell's constructor.

Methods

display()  : void
Default display method for rendering entity notes
initialize()  : void
Initialization logic run at the end of object construction.

Properties

$_validCellOptions

List of valid options that can be passed into this cell's constructor.

protected array<string, mixed> $_validCellOptions = []

Currently empty as this cell doesn't accept configuration options, but maintained for future extensibility.

Methods

display()

Default display method for rendering entity notes

public display(string|int $entity_id, string $entity_type[, bool $viewPrivate = false ][, bool $canCreate = true ]) : void

Fetches and displays notes for a specific entity with proper permission filtering. Creates a new empty note entity for the creation form and retrieves existing notes with author information for display.

The method handles visibility permissions by optionally filtering out private notes based on the user's access level. Notes are displayed chronologically from oldest to newest to maintain conversation flow.

Parameters
$entity_id : string|int

ID of the entity to show notes for (Member, Branch, etc.)

$entity_type : string

Type of entity (e.g., 'Member', 'Branch', 'Award')

$viewPrivate : bool = false

Whether user can view private notes (default: false)

$canCreate : bool = true

Whether user can create new notes (default: true)

Tags
example
// In a Member view template - show public notes only
echo $this->cell('Notes', [
    $member->id,        // Entity ID
    'Member',           // Entity type
    false,              // No private notes
    $canEditMember      // Can create notes
]);

// In admin context - show all notes including private
echo $this->cell('Notes', [
    $award->id,
    'Award',
    true,               // Include private notes
    true                // Can create notes
]);
see
NotesTable::findByEntity()

Alternative finder method

see

templates/cell/Notes/display.php Template that renders the notes interface

Return values
void

Note data and form entity set via $this->set() for template access

initialize()

Initialization logic run at the end of object construction.

public initialize() : void

Currently no initialization required, but maintained for potential future setup needs like service injection.


        
On this page

Search results