# findById function -- where is the source code?

**URL:** <https://discourse.cakephp.org/t/findbyid-function-where-is-the-source-code/2667>\
**Category:** Uncategorized\
**Created:** [June 4, 2017, 11:56pm UTC](https://discourse.cakephp.org/t/findbyid-function-where-is-the-source-code/2667 "2017-06-04T23:56:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![cupboy](https://avatars.discourse-cdn.com/v4/letter/c/e56c9b/32.png) [@cupboy](https://discourse.cakephp.org/u/cupboy)\
**Post date:** [June 4, 2017, 11:56pm UTC](https://discourse.cakephp.org/t/findbyid-function-where-is-the-source-code/2667/1 "2017-06-04T23:56:29Z")

</div>

I cannot find the source code for this. I’ve done a grep search. How can a function be called if the function is not in source code? Has anyone seen where this is? I will keep looking. Checking \lib\Cake\Model\Datasource\Database

Magic Find Types

Weird stuff. I guess it’s better to do my own queries. Not all that into magic.

---

<div class="post-metadata">

**Author:** ![Graziel](https://avatars.discourse-cdn.com/v4/letter/g/71c47a/32.png) [@Graziel](https://discourse.cakephp.org/u/Graziel)\
**Post date:** [June 5, 2017, 5:46am UTC](https://discourse.cakephp.org/t/findbyid-function-where-is-the-source-code/2667/2 "2017-06-05T05:46:49Z")

</div>

its using magic php function [\_\_call](http://php.net/manual/pl/language.oop5.overloading.php#object.call) and its [here](https://github.com/cakephp/cakephp/blob/master/src/ORM/Table.php#L2289-L2291)
