|
const | TABLE = 'documents' |
|
const | PK = 'id_document' |
|
const | STATUS = 'status' |
|
const | RULES = 'rules' |
|
const | ADHESION = 'adhesion' |
|
const | MINUTES = 'minutes' |
|
const | VOTES = 'votes' |
|
const | INVALID_FILENAME = -1 |
|
const | INVALID_EXTENSION = -2 |
|
const | FILE_TOO_BIG = -3 |
|
const | IMAGE_TOO_SMALL = -4 |
|
const | MIME_NOT_ALLOWED = -5 |
|
const | NEW_FILE_EXISTS = -6 |
|
const | INVALID_FILE = -7 |
|
const | CANT_WRITE = -8 |
|
const | MAX_FILE_SIZE = 2048 |
|
const | MIN_CROP_SIZE = 267 |
|
|
writeOnDisk as | trait_writeOnDisk |
|
string | $store_path = GALETTE_DOCUMENTS_PATH |
|
Documents
- Author
- Johan Cwiklinski johan.nosp@m.@x-t.nosp@m.nd.be
◆ __construct()
Galette\Entity\Document::__construct |
( |
Db |
$zdb, |
|
|
int|ArrayObject |
$args = null |
|
) |
| |
Main constructor
- Parameters
-
Db | $zdb | Database instance |
| int|ArrayObject<string,int|string>|null | $args Arguments |
◆ canShow()
Galette\Entity\Document::canShow |
( |
Login |
$login | ) |
|
Check if a document can be shown
- Parameters
-
- Returns
- boolean
◆ getComment()
Galette\Entity\Document::getComment |
( |
| ) |
|
Get comment
- Returns
- ?string
◆ getCreationDate()
Galette\Entity\Document::getCreationDate |
( |
bool |
$formatted = true | ) |
|
Get creation date
- Parameters
-
boolean | $formatted | Return formatted date (default) or not |
- Returns
- string|DateTime
◆ getDocumentFilename()
Galette\Entity\Document::getDocumentFilename |
( |
| ) |
|
Get document file name
- Returns
- string
◆ getErrors()
Galette\Entity\Document::getErrors |
( |
| ) |
|
Get errors
- Returns
- string[]
◆ getId()
Galette\Entity\Document::getId |
( |
| ) |
|
Get document ID
- Returns
- ?int
◆ getList()
Galette\Entity\Document::getList |
( |
string |
$type = null | ) |
|
Get documents
- Parameters
-
string | null | $type | Type to retrieve |
- Returns
- array<int,Document>
- Exceptions
-
◆ getSystemType()
Galette\Entity\Document::getSystemType |
( |
string |
$type, |
|
|
bool |
$translated = true |
|
) |
| |
Get system documents types
- Parameters
-
string | $type | Document type |
boolean | $translated | Return translated types (default) or not |
- Returns
- string
◆ getSystemTypes()
Galette\Entity\Document::getSystemTypes |
( |
bool |
$translated = true | ) |
|
Get system social types
- Parameters
-
boolean | $translated | Return translated types (default) or not |
- Returns
- array<string,string>
◆ getType()
Galette\Entity\Document::getType |
( |
| ) |
|
◆ getTypedList()
Galette\Entity\Document::getTypedList |
( |
| ) |
|
Get list by type
- Returns
- array<string, array<int, Document>>
- Exceptions
-
◆ getTypes()
Galette\Entity\Document::getTypes |
( |
| ) |
|
Get all known types
- Returns
- array<string,string>
- Exceptions
-
◆ getURL()
Galette\Entity\Document::getURL |
( |
| ) |
|
Get file URL
- Returns
- string
◆ handleFiles()
Galette\Entity\Document::handleFiles |
( |
array |
$files | ) |
|
Handle files
- Parameters
-
array<string,mixed> | $files Files sent |
- Returns
- array<string>|true
◆ remove()
Galette\Entity\Document::remove |
( |
array |
$ids = null | ) |
|
Remove document
- Parameters
-
array<int>|null | $ids IDs to remove, default to current id |
- Returns
- boolean
◆ removeFile()
Galette\Entity\Document::removeFile |
( |
| ) |
|
|
protected |
Remove document file
- Returns
- bool
◆ setComment()
Galette\Entity\Document::setComment |
( |
?string |
$comment | ) |
|
Set comment
- Parameters
-
?string | $comment Comment to set |
- Returns
- self
◆ setType()
Galette\Entity\Document::setType |
( |
string |
$type | ) |
|
Set type
- Parameters
-
- Returns
- self
◆ store()
Galette\Entity\Document::store |
( |
array |
$post, |
|
|
array |
$files |
|
) |
| |
Store document in database
- Parameters
-
array<string,mixed> | $post POST data |
array<string,mixed> | $files Files |
- Returns
- boolean
◆ writeOnDisk()
Galette\Entity\Document::writeOnDisk |
( |
string |
$tmpfile, |
|
|
bool |
$ajax |
|
) |
| |
Write file on disk
- Parameters
-
string | $tmpfile | Temporary file |
bool | $ajax | If the file comes from an ajax call (dnd) |
- Returns
- bool|int
The documentation for this class was generated from the following file:
- /home/docs/checkouts/readthedocs.org/user_builds/galette-apidoc/checkouts/develop/galette/lib/Galette/Entity/Document.php