core-bundle/src/Resources/contao/models/FilesModel.php
public static function findByPid($intPid, array $arrOptions=array())
	{
		$t = static::$strTable;

		// Convert UUIDs to binary
		if (Validator::isStringUuid($intPid))
		{
			$intPid = StringUtil::uuidToBin($intPid);
		}

		return static::findBy(array("$t.pid=UNHEX(?)"), bin2hex($intPid), $arrOptions);
	}
public static function findByPid($intPid, array $arrOptions=array())
	{
		$t = static::$strTable;

		// Convert UUIDs to binary
		if (Validator::isStringUuid($intPid))
		{
			$intPid = StringUtil::uuidToBin($intPid);
		}

		return static::findBy(array("$t.pid=UNHEX(?)"), bin2hex($intPid), $arrOptions);
	}
Find a file by its parent ID

@param mixed $intPid     The parent ID
@param array $arrOptions An optional options array

@return Collection|FilesModel[]|FilesModel|null A collection of models or null if there are no files