NAME

Yancy::Model::Item - Interface to a single item

VERSION

version 1.088

SYNOPSIS

my $schema = $model->schema( 'foo' );
my $item = $schema->get( $id );

$item->set( $data );
$item->delete;

DESCRIPTION

NOTE: This module is experimental and it's API may change before Yancy v2!

For information on how to extend this module to add your own schema and item methods, see Yancy::Guides::Model.

ATTRIBUTES

schema

The Yancy::Model::Schema object containing this item.

data

The row data for this item.

METHODS

model

The Yancy::Model object that contains this item.

id

The ID field for the item. Returns a string or a hash-reference (for composite keys).

set

Set data in this item. Returns true if successful.

delete

Delete this item from the database. Returns true if successful.

SEE ALSO

Yancy::Guides::Model

AUTHOR

Doug Bell <preaction@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2021 by Doug Bell.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.