Skip to content

Commit edf1388

Browse files
authored
Merge pull request #264 from raicabogdan/5.9.x
Update documentation links and add a warning for relation delete() callback
2 parents b222db0 + 90a6952 commit edf1388

20 files changed

+82
-47
lines changed

docs/autoload.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -746,3 +746,4 @@ Unregister the autoload method
746746
[loader]: api/phalcon_autoload.md#autoloadloader
747747
[loader-exception]: api/phalcon_autoload.md#autoloadexception
748748
[eventsawareinterface]: api/phalcon_events.md#eventseventsawareinterface
749+
[events]: api/phalcon_events.md#eventsmanager

docs/config.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -870,3 +870,4 @@ Also in views (Volt syntax)
870870
[parse-ini-file]: https://www.php.net/manual/en/function.parse-ini-file.php
871871
[yaml-parse-file]: https://www.php.net/manual/en/function.yaml-parse-file.php
872872
[di]: di.md
873+
[support-collection]: support-collection.md

docs/controllers.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,3 +625,5 @@ $container->set(
625625
[events]: events.md
626626
[application]: application.md
627627
[autoload]: autoload.md
628+
[routing]: routing.md
629+
[views]: views.md

docs/db-models-relationships.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,6 +1398,19 @@ $customer->getInvoices()->delete();
13981398

13991399
`delete()` also accepts an anonymous function to filter what records must be deleted:
14001400

1401+
!!! warning "NOTE"
1402+
1403+
`delete()` only works safely with `hasMany()` relationships. The deletion callback runs before the actual deletion of the parent model.
1404+
1405+
This makes it safe for:
1406+
1407+
- Deleting child models that hold a foreign key to the parent (e.g., hasMany)
1408+
1409+
But unsafe for:
1410+
1411+
- Deleting related models that the parent depends on via a foreign key (e.g., belongsTo or hasOne where FK is in parent)
1412+
1413+
14011414
```php
14021415
<?php
14031416

docs/di.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1604,6 +1604,7 @@ The [Phalcon\Di\DiInterface][di-diinterface] interface must be implemented to cr
16041604
[annotations]: annotations.md
16051605
[ssets]: ssets.md
16061606
[encryption-crypt]: encryption-crypt.md
1607+
[assets]: assets.md
16071608
[response-cookies]: response.md#cookies
16081609
[dispatcher]: dispatcher.md
16091610
[html-escaper]: html-escaper.md
@@ -1621,4 +1622,5 @@ The [Phalcon\Di\DiInterface][di-diinterface] interface must be implemented to cr
16211622
[db-models-transactions]: db-models-transactions.md
16221623
[mvc-url]: mvc-url.md
16231624
[db-layer]: db-layer.md
1624-
[session#bag]: session.md#bag
1625+
[session-bag]: session.md#bag
1626+
[singletons]: https://en.wikipedia.org/wiki/Singleton_pattern

docs/encryption-crypt.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ The `encryptBase64()` can be used to encrypt a string in a URL-friendly way. It
161161
The `decryptBase64()` can be used to decrypt a string in a URL-friendly way. Similar to `encryptBase64()` it uses `decrypt()` internally and accepts the `text` and optionally the `key` of the element to encrypt. There is also a third parameter `safe` (defaults to `false`) which will perform string replacements for previously replaced non URL _friendly_ characters such as `+` or `/`.
162162

163163
## Exceptions
164-
Exceptions thrown in the [Phalcon\Encryption\Crypt][crypt] component will be of type [Phalcon\Encryption\Crypt\Exception][config-exception]. If however, you are using signing and the calculated hash for `decrypt()` does not match, [Phalcon\Encryption\Crypt\Mismatch][crypt-mismatch] will be thrown. You can use these exceptions to selectively catch exceptions thrown only from this component.
164+
Exceptions thrown in the [Phalcon\Encryption\Crypt][crypt] component will be of type [Phalcon\Encryption\Crypt\Exception][crypt-exception]. If however, you are using signing and the calculated hash for `decrypt()` does not match, [Phalcon\Encryption\Crypt\Mismatch][crypt-mismatch] will be thrown. You can use these exceptions to selectively catch exceptions thrown only from this component.
165165

166166
```php
167167
<?php
@@ -190,7 +190,7 @@ The getter `getCipher()` returns the currently selected cipher. If none has been
190190
You can always get an array of all the available ciphers for your system by calling `getAvailableCiphers()`.
191191

192192
### Hash Algorithm
193-
The getter `getHashAlgo()` returns the hashing algorithm used by the component. If none has been explicitly defined by the setter `setHashAlgo()` the `sha256` will be used. If the hash algorithm defined is not available in the system or is wrong, a [Phalcon\Encryption\Crypt\Exception][crypt=exception] will be thrown.
193+
The getter `getHashAlgo()` returns the hashing algorithm used by the component. If none has been explicitly defined by the setter `setHashAlgo()` the `sha256` will be used. If the hash algorithm defined is not available in the system or is wrong, a [Phalcon\Encryption\Crypt\Exception][crypt-exception] will be thrown.
194194

195195
You can always get an array of all the available hashing algorithms for your system by calling `getAvailableHashAlgos()`.
196196

docs/encryption-security-jwt.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ $signer = new Hmac('sha256');
222222
$signer = new Hmac('sha111'); // exception
223223
```
224224

225-
The component utilizes the [hmac_equals][hmac_equals] and [hash_hmac][hash_hmac] PHP methods internally to verify and sign the payload. It exposes the following methods:
225+
The component utilizes the [hash_equals][hash-equals] and [hash_hmac][hash-hmac] PHP methods internally to verify and sign the payload. It exposes the following methods:
226226

227227
```php
228228
public function getAlgHeader(): string

docs/events.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -965,6 +965,7 @@ The events available in Phalcon are:
965965

966966
[db]: api/phalcon_db.md
967967
[di-factorydefaul]: api/phalcon_di.md#difactorydefault
968+
[di-injectable]: api/phalcon_di.md#diinjectable
968969
[events-event]: api/phalcon_events.md#eventsevent
969970
[events-eventinterface]: api/phalcon_events.md#eventseventinterface
970971
[events-eventsawareinterface]: api/phalcon_events.md#eventseventsawareinterface

docs/filter-filter.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,7 @@ $filteredIp = $locator->sanitize('127.0.0.1', 'ipv4');
575575
[absint]: https://www.php.net/manual/en/function.absint.php
576576
[filter]: https://www.php.net/manual/en/book.filter.php
577577
[filter_var]: https://www.php.net/manual/en/function.filter-var.php
578+
[htmlspecialchars]: https://www.php.net/manual/en/function.htmlspecialchars.php
578579
[intval]: https://www.php.net/manual/en/function.intval.php
579580
[invoke]: https://www.php.net/manual/en/language.oop5.magic.php#object.invoke
580581
[lcfirst]: https://www.php.net/manual/en/function.lcfirst.php

docs/flash.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,3 +579,4 @@ class InvoicesController extends Controller
579579
[flash-session]: api/phalcon_flash.md#flashsession
580580
[di-injectable]: api/phalcon_di.md#diinjectable
581581
[factorydefault]: api/phalcon_di.md#difactorydefault
582+
[bootstrap]: https://getbootstrap.com/

0 commit comments

Comments
 (0)